Skip to content

Commit

Permalink
* add timezone(zone, timestamp) testcases
Browse files Browse the repository at this point in the history
Signed-off-by: chagelo <[email protected]>
  • Loading branch information
chagelo committed Nov 21, 2024
1 parent bc69f0b commit 9eb085d
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 198 deletions.
5 changes: 2 additions & 3 deletions src/expr/impl/src/scalar/timestamptz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ pub fn timestamp_at_time_zone(input: Timestamp, time_zone: &str) -> Result<Times
Ok(Timestamptz::from_micros(usec))
}

#[function("timezone(varchar, timestamp) -> timestamp")]
pub fn timezone_timestamp_at_time_zone(time_zone: &str, input: Timestamp) -> Result<Timestamp> {
#[function("timezone(varchar, timestamp) -> timestamptz")]
pub fn timezone_timestamp_at_time_zone(time_zone: &str, input: Timestamp) -> Result<Timestamptz> {
timestamp_at_time_zone(input, time_zone)
.map(|timestamptz| timestamptz.to_datetime_utc().naive_utc().into())
}

#[function("timezone(varchar, timestamptz) -> timestamp")]
Expand Down
Loading

0 comments on commit 9eb085d

Please sign in to comment.