[ https://issues.apache.org/jira/browse/SPARK-27546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16823801#comment-16823801 ]
Jiatao Tao commented on SPARK-27546: ------------------------------------ see an example like this: {code:java} // config spark session with "spark.sql.session.timeZone", "UTC" val df = mockDF // TimeZone.setDefault(TimeZone.getTimeZone("UTC")) val date = new Date(1356998400000L) // 2013-01-01 (UTC) val ts = df.select(lit(date).cast(TimestampType).cast(DateType)).head().getDate(0).getTime {code} The ts I got is: 1356969600000 (12/31/2012 UTC) When I set "TimeZone.setDefault(TimeZone.getTimeZone("UTC"))", the ts is same with 1356998400000. > Should repalce DateTimeUtils#defaultTimeZoneuse with sessionLocalTimeZone > ------------------------------------------------------------------------- > > Key: SPARK-27546 > URL: https://issues.apache.org/jira/browse/SPARK-27546 > Project: Spark > Issue Type: Improvement > Components: SQL > Affects Versions: 2.4.1 > Reporter: Jiatao Tao > Priority: Minor > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org