TruncToMillisecond
Truncates a datetime value to the millisecond.
Syntax
-
TruncToMillisecond(t)-
tis a datetime structure or a timestamp
-
Description
If t is a DateTime structure or a timestamp, then TruncToMillisecond(t) returns t rounded to the nearest preceding millisecond.
TruncToMillisecond(t) is a DateTime structure or a timestamp if t is.
Since a DateTime structure only has millisecond resolution, TruncToMillisecond returns such a structure unaltered.
Examples
t ≔ datetime(1985, 06, 07, 18, 20, 52, 137)
date.year: 1985 date.month: June date.day: 7 time.hour: 18 time.minute: 20 time.second: 52 time.millisecond: 137
TruncToMillisecond(t)
date.year: 1985 date.month: June date.day: 7 time.hour: 18 time.minute: 20 time.second: 52 time.millisecond: 137
t ≔ 31205.7644923302481;
TruncToMillisecond(t) \ 18
31205.7644923263906