jayzhan211 commented on issue #10368:
URL: https://github.com/apache/datafusion/issues/10368#issuecomment-2095237393

   See the result in Postgres
   ```
   postgres=# set timezone to '+08';
   SET
   postgres=# select '2020-11-30T08:00:00.000Z'::timestamp at time zone 
'Europe/Brussels';
           timezone        
   ------------------------
    2020-11-30 15:00:00+08
   (1 row)
   
   postgres=# set timezone to '+01';
   SET
   postgres=# select '2020-11-30T08:00:00.000Z'::timestamp at time zone 
'Europe/Brussels';
           timezone        
   ------------------------
    2020-11-30 08:00:00+01
   (1 row)
   
   postgres=# set timezone to '+00';
   SET
   postgres=# select '2020-11-30T08:00:00.000Z'::timestamp at time zone 
'Europe/Brussels';
           timezone        
   ------------------------
    2020-11-30 07:00:00+00
   (1 row)
   ```
   
   I think we should not return 9:00:00, because the local time for timezone +1 
is 8:00:00.
   If I understand correctly, the function you proposing is similar to the 
example above, but the timezone is given into the function?
   
   so `select to_local_time('2020-11-30T08:00:00.000Z'::timestamp, '+01'); ` 
should return `2020-11-30 08:00:00`, `select 
to_local_time('2020-11-30T08:00:00.000Z'::timestamp, '+00'); ` should return 
`2020-11-30 07:00:00` and likewise `2020-11-30 15:00:00` for '+08'
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to