Skip to main content

Module timestamp

Module timestamp 

Source

StructsΒ§

AdjustTimestampPrecision
AdjustTimestampTzPrecision
CastTimestampToDate
CastTimestampToString
CastTimestampToTime
CastTimestampToTimestampTz
CastTimestampTzToDate
CastTimestampTzToString
CastTimestampTzToTime
CastTimestampTzToTimestamp
DatePartInterval
DatePartTimestamp
DatePartTimestampTz
DateTruncTimestamp
DateTruncTimestampTz
ExtractInterval
ExtractTimestamp
ExtractTimestampTz
TimezoneTimestamp
TimezoneTimestampTz
ToCharTimestamp
ToCharTimestampTz

FunctionsΒ§

cast_timestamp_to_date πŸ”’
cast_timestamp_to_string πŸ”’
cast_timestamp_to_time πŸ”’
cast_timestamp_tz_to_date πŸ”’
cast_timestamp_tz_to_string πŸ”’
cast_timestamp_tz_to_time πŸ”’
checked_add_with_leapsecond πŸ”’
Checked addition that is missing from chrono. Adapt its methods here but add a check.
date_part_interval_inner
date_part_timestamp_inner
date_trunc_inner
most_significant_unit πŸ”’
Will extracting this unit from the timestamp include the β€œmost significant bits” of the timestamp?
timezone_timestamp
Converts the timestamp dt, which is assumed to be in the time of the timezone tz to a timestamptz in UTC. This operation is fallible because certain timestamps at timezones that observe DST are simply impossible or ambiguous. In case of ambiguity (when a hour repeats) we will prefer the latest variant, and when an hour is impossible, we will attempt to fix it by advancing it. For example, EST and 2020-11-11T12:39:14 would return 2020-11-11T17:39:14Z. A DST observing timezone like America/New_York would cause the following DST anomalies: 2020-11-01T00:59:59 -> 2020-11-01T04:59:59Z and 2020-11-01T01:00:00 -> 2020-11-01T06:00:00Z 2020-03-08T02:59:59 -> 2020-03-08T07:59:59Z and 2020-03-08T03:00:00 -> 2020-03-08T07:00:00Z
timezone_timestamptz
Converts the UTC timestamptz utc to the local timestamp of the timezone tz. For example, EST and 2020-11-11T17:39:14Z would return 2020-11-11T12:39:14.