File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -201,8 +201,11 @@ impl ToDuckDBScalar for ExtScalar<'_> {
201201 _ => vortex_bail ! ( "cannot have TimeUnit {unit}, so represent a day" ) ,
202202 } ,
203203 TemporalMetadata :: Timestamp ( unit, tz) => {
204- if tz. is_some ( ) {
205- todo ! ( "timezones to duckdb scalar" )
204+ if let Some ( tz) = tz {
205+ if tz != "UTC" {
206+ todo ! ( )
207+ }
208+ return Ok ( Value :: new_timestamp_tz ( value ( ) ?) ) ;
206209 }
207210 match unit {
208211 TimeUnit :: Nanoseconds => Ok ( Value :: new_timestamp_ns ( value ( ) ?) ) ,
Original file line number Diff line number Diff line change @@ -197,6 +197,14 @@ impl Value {
197197 }
198198 }
199199
200+ pub fn new_timestamp_tz ( micros : i64 ) -> Self {
201+ unsafe {
202+ Self :: own ( cpp:: duckdb_create_timestamp_tz ( cpp:: duckdb_timestamp {
203+ micros,
204+ } ) )
205+ }
206+ }
207+
200208 pub fn new_timestamp_ns ( nanos : i64 ) -> Self {
201209 unsafe {
202210 Self :: own ( cpp:: duckdb_create_timestamp_ns ( cpp:: duckdb_timestamp_ns {
You can’t perform that action at this time.
0 commit comments