Date functions
<calendar> - Calendar.
Financial Toolbox calendar functions.
Current Time And Date.
now - Current date and time.
today - Current date.
Date and Time Components and Formats.
datefind - Indices of date numbers in matrix.
datevec - Date components.
day - Day of month.
eomdate - Last date of month.
eomday - Last day of month.
hour - Hour of date or time.
lweekdate - Date of last occurrence of weekday in month.
minute - Minute of date or time.
month - Month of date.
months - Number of whole months between dates.
nweekdate - Date of specific occurrence of weekday in month.
second - Second of date or time.
weekday - Day of the week.
year - Year of date.
yeardays - Number of days in year.
Date Conversion.
date2time - Time and frequency from dates.
datedisp - Display a matrix containing date number entries.
datenum - Create date number.
datestr - Create date string.
dec2thirtytwo - Decimal quotation to thirty-second.
m2xdate - MATLAB date to Excel date.
thirtytwo2dec - Thirty-second quotation to decimal.
time2date - Dates from time and frequency.
X2mdate - Excel date to matlab date.
Financial dates.
busdate - Next or previous business day.
busdays - Business days in serial date format.
datemnth - Date of day in future or past month.
datewrkdy - Date of future or past workday.
daysadd - Days into future or past from any day count basis.
days252bus - Business days between dates.
days360 - Days between dates based on 360 day year (SIA).
days360e - Days between dates based on 360 day year (Europe).
days360isda - Days between dates based on 360 day year (ISDA).
days360psa - Days between dates based on 360 day year (PSA).
days365 - Days between dates based on 365 day year.
daysact - Days between dates based on actual year.
daysadd - Date away from a starting date for any day-count basis.
daysdif - Days between dates for any day count basis.
fbusdate - First business date of month.
holidays - Holidays and non-trading days.
Isbusday - True for dates that are business days.
lbusdate - Last business date of month.
thirdwednesday - Third-Wednesday of the month.
wrkdydif - Number of working days between dates.
yearfrac - Fraction of year between dates.
Coupon bond dates.
accrfrac - Accrued interest coupon period fraction.
cfamounts - Cash flow amounts for a security.
cfdates - Cash flow dates for a security.
cfport - Portfolio form of cash flows.
cftimes - Cash flow time factors for a security.
cpncount - Coupons payable between dates.
cpndaten - Next coupon date after date.
cpndatenq - Next quasi-coupon date after date.
cpndatep - Previous coupon date before date.
cpndatepq - Previous quasi-coupon date before date.
cpndaysn - Number of days between date and next coupon date.
cpndaysp - Number of days between date and previous coupon date.
cpnpersz - Size in days of period containing date.
Calendar (Graphical User Interface).
uicalendar - Graphical calendar that interfaces with uicontrols.
calendar is both a directory and a function.
CALENDAR Calendar.
CALENDAR or CALENDAR(DATE) or CALENDAR(YEAR,MONTH) is a 6-by-7 matrix containing a calendar for the current or specified month.
The first column of the returned matrix corresponds to Sunday.
See also datenum.
Reference page in Help browser
doc calendar
<weekday> - Day of week.
WEEKDAY Day of week.
[D,W] = WEEKDAY(T) returns the day of the week in numeric and
string form given T, a serial date number or a date string. This
returns the short English days of the week.
[D, W] = WEEKDAY(T, FORM) :
[D, W] = WEEKDAY(T, LOCALE):
[D, W] = WEEKDAY(T, FORM, LOCALE):
The form argument can be one of:
short -- short days of the week (Default)
long -- long days of the week
The locale argument can be one of:
local -- Use local format
en_US -- Use default, US English format (Default)
Both of these arguments are optional and can come in any order,
following the date number.
The days of the week are assigned the following values, for the
English locales:
1 Sun
2 Mon
3 Tue
4 Wed
5 Thu
6 Fri
7 Sat
For other language locales, the second return argument will
contain the equivalent weekday name for that locale.
For example, [d,w] = weekday(728647) or [d,w] = weekday('19-Dec-1994')
returns d = 2 and w = Mon for the English locales.
See also eomday, datenum, datevec.
Reference page in Help browser
doc weekday
<eomday> - End of month.
EOMDAY End of month.
D = EOMDAY(Y,M) returns the last day of the month for the given
year, Y, and month, M.
Algorithm:
"Thirty days hath September, ..."
See also weekday, datenum, datevec.
Reference page in Help browser
doc eomday
<datetick> - Date formatted tick labels.
DATETICK Date formatted tick labels.
DATETICK(TICKAXIS,DATEFORM) annotates the specified tick axis with
date formatted tick labels. TICKAXIS must be one of the strings
'x','y', or 'z'. The default is 'x'. The labels are formatted
according to the format number or string DATEFORM (see tables
below). If no DATEFORM argument is entered, DATETICK makes a
guess based on the data for the objects within the specified axis.
To produce correct results, the data for the specified axis must
be serial date numbers (as produced by DATENUM).
Table 1: Standard MATLAB Date format definitions
DATEFORM number DATEFORM string Example
===========================================================
0 'dd-mmm-yyyy HH:MM:SS' 01-Mar-2000 15:45:17
1 'dd-mmm-yyyy' 01-Mar-2000
2 'mm/dd/yy' 03/01/00
3 'mmm' Mar
4 'm' M
5 'mm' 03
6 'mm/dd' 03/01
7 'dd' 01
8 'ddd' Wed
9 'd' W
10 'yyyy' 2000
11 'yy' 00
12 'mmmyy' Mar00
13 'HH:MM:SS' 15:45:17
14 'HH:MM:SS PM' 3:45:17 PM
15 'HH:MM' 15:45
16 'HH:MM PM' 3:45 PM
17 'QQ-YY' Q1-96
18 'QQ' Q1
19 'dd/mm' 01/03
20 'dd/mm/yy' 01/03/00
21 'mmm.dd,yyyy HH:MM:SS' Mar.01,2000 15:45:17
22 'mmm.dd,yyyy' Mar.01,2000
23 'mm/dd/yyyy' 03/01/2000
24 'dd/mm/yyyy' 01/03/2000
25 'yy/mm/dd' 00/03/01
26 'yyyy/mm/dd' 2000/03/01
27 'QQ-YYYY' Q1-1996
28 'mmmyyyy' Mar2000
29 (ISO 8601) 'yyyy-mm-dd' 2000-03-01
30 (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
31 'yyyy-mm-dd HH:MM:SS' 2000-03-01 15:45:17
Table 2: Free-form date format symbols
Symbol Interpretation of format symbol
===========================================================
yyyy full year, e.g. 1990, 2000, 2002
yy partial year, e.g. 90, 00, 02
mmmm full name of the month, according to the calendar locale, e.g.
"March", "April" in the UK and USA English locales.
mmm first three letters of the month, according to the calendar
locale, e.g. "Mar", "Apr" in the UK and USA English locales.
mm numeric month of year, padded with leading zeros, e.g. ../03/..
or ../12/..
m capitalized first letter of the month, according to the
calendar locale; for backwards compatibility.
dddd full name of the weekday, according to the calendar locale,
e.g. "Monday", "Tuesday", for the UK and USA calendar locales.
ddd first three letters of the weekday, according to the calendar
locale, e.g. "Mon", "Tue", for the UK and USA calendar locales.
dd numeric day of the month, padded with leading zeros, e.g.
05/../.. or 20/../..
d capitalized first letter of the weekday; for backwards
compatibility
HH hour of the day, according to the time format. In case the time
format AM | PM is set, HH does not pad with leading zeros. In
case AM | PM is not set, display the hour of the day, padded
with leading zeros. e.g 10:20 PM, which is equivalent to 22:20;
9:00 AM, which is equivalent to 09:00.
MM minutes of the hour, padded with leading zeros, e.g. 10:15,
10:05, 10:05 AM.
SS second of the minute, padded with leading zeros, e.g. 10:15:30,
10:05:30, 10:05:30 AM.
FFF milliseconds field, padded with leading zeros, e.g.
10:15:30.015.
PM set the time format as time of morning or time of afternoon. AM
or PM is appended to the date string, as appropriate.
DATETICK(...,'keeplimits') changes the tick labels into date-based
labels while preserving the axis limits.
DATETICK(....'keepticks') changes the tick labels into date-based labels
without changing their locations. Both 'keepticks' and 'keeplimits' can
be used at the same time.
DATETICK(AX,...) uses the specified axes, rather than the current axes.
DATETICK relies on DATESTR to convert date numbers to date strings.
Example (based on the 1990 U.S. census):
t = (1900:10:1990)'; % Time interval
p = [75.995 91.972 105.711 123.203 131.669 ...
