Programming and Data Types    

Dates and Times

MATLAB provides functions for time and date handling. These functions are in a directory called timefun in the MATLAB Toolbox.

Category
Function
Description
Current date and time
clock
Current date and time as date vector

date
Current date as date string

now
Current date and time as serial date number
Conversion
datenum
Convert to serial date number

datestr
Convert to string representation of date

datevec
Date components
Utility
calendar
Calendar

datetick
Date formatted tick labels

eomday
End of month

weekday
Day of the week
Timing
cputime
CPU time in seconds

etime
Elapsed time

tic, toc
Stopwatch timer


  String Evaluation Date Formats