Skip to content

clock

Current date and time as a 6-element vector.

t = clock

Returns the current date/time as [year month day hour minute second]. The seconds element is fractional — sub-second precision included.

clock % e.g. [2026 4 28 13 25 51.123]
  • now — Current date and time as a serial date-time number.
  • date — Construct a date serial number from year, month, day.
  • datevec — Convert a date to a 6-element date vector.