Skip to content

Commit bc404ae

Browse files
authored
fix: timezone display (#54)
# Rationale for this change Arrow displays inconsistent behavior when instantiating timestamp record columns which include timezones. It is observed that "00:00" is interpreted as a valid timezone string by arrow, but "+00:00" is. # What changes are included in this PR? This PR simply updates the display impl for timezone to match this expectation. # Are these changes tested? yes
1 parent a9c5726 commit bc404ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/proof-of-sql-parser/src/posql_time/timezone.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl fmt::Display for PoSQLTimeZone {
5757
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5858
match *self {
5959
PoSQLTimeZone::Utc => {
60-
write!(f, "00:00")
60+
write!(f, "+00:00")
6161
}
6262
PoSQLTimeZone::FixedOffset(seconds) => {
6363
let hours = seconds / 3600;
@@ -91,7 +91,7 @@ mod timezone_parsing_tests {
9191
#[test]
9292
fn test_display_utc() {
9393
let timezone = timezone::PoSQLTimeZone::Utc;
94-
assert_eq!(format!("{}", timezone), "00:00");
94+
assert_eq!(format!("{}", timezone), "+00:00");
9595
}
9696
}
9797

0 commit comments

Comments
 (0)