Skip to main content

parse_timestamp_tz

Function parse_timestamp_tz 

Source
pub fn parse_timestamp_tz(text: &str) -> Option<PgTimestampTz>
Expand description

Parse a parse_timestamp layout followed by a Z, ±HH, ±HHMM, ±HH:MM or ±HH:MM:SS offset, then PostgreSQL’s optional BC, or infinity and -infinity.

let at = sql_values::postgres::parse_timestamp_tz("2024-01-02T03:04:05+02:00").unwrap();
assert_eq!(at.to_string(), "2024-01-02 01:04:05+00");