SDK

truncate_timestamp

`truncateTimestamp` from the web app: zero everything finer than `precision`, in UTC. `month` sets the day to 1 (it keeps the month, it does not zero it). >>> truncate_timestamp("1984-03-17T15:42:10Z", "month") '1984-03-01T00:00:00.000Z'

On this page

function

Signature #

def truncate_timestamp(value: date | datetime | str, precision: TimePrecision) -> str

truncateTimestamp from the web app: zero everything finer than precision, in UTC.

month sets the day to 1 (it keeps the month, it does not zero it).

truncate_timestamp("1984-03-17T15:42:10Z", "month") '1984-03-01T00:00:00.000Z'