Financial Toolbox    
datevec

Date components

Syntax

Description

DateVector = datevec(Date) converts a date number or a date string to a date vector whose elements are [Year Month Day  Hour Minute Second]. The first five elements are integers, the sixth is a floating-point number. Date strings with two-character years, e.g., 12-june-12, are assumed to lie within the 100-year period centered about the current year.

DateVector = datevec(Date, Pivot) assumes that two-character years lie within the 100-year period beginning with the pivot year. The default pivot year is the current year minus 50 years.

[Year, Month, Day, Hour, Minute, Second] = datevec(Date) converts a date number or a date string to a date vector and returns the components of the date vector as individual variables.

Examples

See Also

datenum, datestr, now, today


  datestr datewrkdy