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-578040196
 
 
   > With zone id string, you have something like +01:00 in mind, right?
   
   You can say to `TimestampFormatter` that you set time zone name, see 
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html:
   ```scala
   scala> import org.apache.spark.sql.functions._
   import org.apache.spark.sql.functions._
   
   scala> val df = Seq("2019-01-24 11:30:00.123 PST").toDF("ts_str")
   df: org.apache.spark.sql.DataFrame = [ts_str: string]
   
   scala> df.select(to_timestamp($"ts_str", "uuuu-MM-dd HH:mm:ss.SSS 
z")).show(false)
   +---------------------------------------------------+
   |to_timestamp(`ts_str`, 'uuuu-MM-dd HH:mm:ss.SSS z')|
   +---------------------------------------------------+
   |2019-01-24 22:30:00.123                            |
   +---------------------------------------------------+
   ```

----------------------------------------------------------------
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