devanbenz commented on issue #12218:
URL: https://github.com/apache/datafusion/issues/12218#issuecomment-2350136729

   > > Datafusion needs to implement something similar to the following in 
Clickhouse for casting to timestamp with a specified timezone:
   > 
   > I think you can do it like
   > 
   > ```sql
   > select now() AT TIME ZONE 'America/Denver';
   > ```
   > 
   > Though it would be awesome if that was documented (it doesn't appear to be 
in the SQL reference): 
[datafusion.apache.org/search.html?q=AT+TIMEZONE](https://datafusion.apache.org/search.html?q=AT+TIMEZONE)
   
   I was thinking more so when casting to a `timestamp` 
   
   example:
   
   ```
   > select (now() at time zone 'America/Chicago')::timestamp;
   +----------------------------+
   | now()                      |
   +----------------------------+
   | 2024-09-13T20:45:16.085603 |
   +----------------------------+
   1 row(s) fetched.
   Elapsed 0.007 seconds.
   
   > select (now() at time zone 'America/Chicago')::timestamp at time zone 
'America/Chicago';
   +----------------------------------+
   | now()                            |
   +----------------------------------+
   | 2024-09-13T20:45:28.485804-05:00 |
   +----------------------------------+
   ```
   
   When casting to a `timestamp` it is not really *honoring* the timezone if 
that is the right way of putting it haha. 


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to