Financial Toolbox
  Go to function:
    Search    Help Desk 
datevec    Examples   See Also

Date components.

Syntax

Description

dv = datevec(d) converts a date number or a date string d to a date vector dv 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.

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

[y, mo, d, h, mi, s] = datevec(d) converts a date number or a date string d to a date vector and returns the components of the date vector as individual variables y year, mo month, d day, h hour, mi minute, and s second.

Note:
This function now ships with basic MATLAB. It originally shipped only with the Financial Toolbox, and this description remains here for your convenience.

Examples

See Also

datenum, datestr, now, today



[ Previous | Help Desk | Next ]