Documentation

days360psa

Days between dates based on 360-day year (Public Securities Association (PSA) compliant)

Synopsis

NumDays = days360psa(StartDate, EndDate)

Arguments

StartDate

Row vector, column vector, or scalar value in serial date number, date character vector, or datetime array format.

EndDate

Row vector, column vector, or scalar value in serial date number, date character vector, or datetime array format.

Either input can contain multiple values, but if so, the other must contain the same number of values or a single value that applies to all.

Description

NumDays = days360psa(StartDate, EndDate) returns a vector or scalar value representing the number of days between StartDate and EndDate based on a 360-day year (that is, all months contain 30 days). If EndDate is earlier than StartDate, NumDays is negative. NumDays returns as a double for serial date number, date character vector, and datetime inputs.

Under this payment convention, all months contain 30 days. In both leap and non-leap years, if the StartDate is the last day of February, this day is considered to be day 30 of the month.

Examples

Example 1. Use this convention to find the number of days in between the last day of February and the first day of March during a leap year.

StartDate = '29-Feb-2000';
EndDate = '1-Mar-2000';
NumDays = days360psa(StartDate, EndDate)
NumDays =

    1

Example 2. Use this convention to find the number of days in between the last day of February and the first day of March during a leap year using a datetime array.

NumDays = days360psa(datetime('29-Feb-2000','Locale','en_US'), '1-Mar-2000')
NumDays =

    1

Example 3. Use this convention to find the number of days in between the last day of February and the first day of March during a non-leap year.

StartDate = '28-Feb-2002';
EndDate = '1-Mar-2002';
NumDays = days360psa(StartDate, EndDate)
NumDays =

    1

As expected, the number of days in both cases is the same. The convention always assumes that the last day of February is the 30th day.

Related Examples

Introduced before R2006a

Was this topic helpful?