Algosim documentation: TruncToSecond

TruncToSecond

Truncates a datetime value to the second.

Syntax

Description

If t is a DateTime structure or a timestamp, then TruncToSecond(t) returns t rounded to the nearest preceding second; effectively, it sets the millisecond part to zero.

TruncToSecond(t) is a DateTime structure or a timestamp if t is.

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
TruncToSecond(t)
date.year: 1985
date.month: June
date.day: 7
time.hour: 18
time.minute: 20
time.second: 52
time.millisecond: 0