MaxGekk commented on issue #24195: [SPARK-25496][SQL] Deprecate 
from_utc_timestamp and to_utc_timestamp
URL: https://github.com/apache/spark/pull/24195#issuecomment-478239953
 
 
   FYI, I investigated the second issue in 
https://github.com/apache/spark/pull/24195#issuecomment-476870628 when 
`DateTimeUtils.getHours` gets `GMT` (`UTC-00:00`) instead of `UTC-11:00`. The 
problem is in conversion `String` -> `TimeZone`. `TimeZone.getTimeZone` doesn't 
recognize time zone offsets like `UTC+/HH:mm` but can `GMT+/-HH:mm`. For 
example:
   ```scala
   scala> java.util.TimeZone.getTimeZone("UTC+01:00")
   res2: java.util.TimeZone = 
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
   ```
   So, `TimeZone.getTimeZone` just converts `UTC+01:00` to `GMT` silently. I 
thinks we should move aways from "legacy" `java.util.TimeZone` and use 
`java.time.ZoneId` everywhere.  

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to