Expand description
Datetime arithmetic helpers: UTC timestamp ↔ civil calendar conversion, formatting, parsing.
Functions§
- civil_
from_ days - Converts a day count since the Unix epoch to a proleptic Gregorian date.
Returns
(year, month, day)where month and day are 1-based. - civil_
to_ timestamp - Assembles a Unix timestamp (seconds) from calendar components.
- days_
from_ civil - Converts a proleptic Gregorian date (y, m, d) to a day count since the Unix epoch. Month is 1-based; day is 1-based.
- format_
datestr - Formats a Unix timestamp using a pattern string.
Supported tokens:
yyyy,MMM(abbreviated month name),MM,dd,HH,mm,ss,SSS. - format_
datetime - Formats a Unix timestamp as
yyyy-MM-dd HH:mm:ss. - format_
duration - Formats a duration in seconds as
HH:MM:SSorNd HH:MM:SS. Adds.mmmsuffix when sub-second precision is present. - from_
datenum - Converts a MATLAB serial date number to a Unix timestamp.
- now_
timestamp - Returns the current UTC time as a Unix timestamp.
- parse_
iso8601 - Parses an ISO 8601 date string:
yyyy-MM-ddoryyyy-MM-dd HH:mm:ss. - timestamp_
to_ civil - Decomposes a Unix timestamp (seconds) into calendar components.
Returns
(year, month, day, hour, minute, second_f64). - to_
datenum - Converts a Unix timestamp to a MATLAB serial date number.
- today_
timestamp - Returns midnight today as a Unix timestamp.