aboutsummaryrefslogtreecommitdiff
path: root/repl/scala-2.11/src
diff options
context:
space:
mode:
authorDavies Liu <davies@databricks.com>2016-06-19 00:34:52 -0700
committerDavies Liu <davies.liu@gmail.com>2016-06-19 00:34:52 -0700
commit001a58960311b07fe80e2f01e473f4987948d06e (patch)
tree0f03c7223caf457798ca5306dec9c1c8fbca08c1 /repl/scala-2.11/src
parentce3b98bae28af72299722f56e4e4ef831f471ec0 (diff)
downloadspark-001a58960311b07fe80e2f01e473f4987948d06e.tar.gz
spark-001a58960311b07fe80e2f01e473f4987948d06e.tar.bz2
spark-001a58960311b07fe80e2f01e473f4987948d06e.zip
[SPARK-15613] [SQL] Fix incorrect days to millis conversion due to Daylight Saving Time
## What changes were proposed in this pull request? Internally, we use Int to represent a date (the days since 1970-01-01), when we convert that into unix timestamp (milli-seconds since epoch in UTC), we get the offset of a timezone using local millis (the milli-seconds since 1970-01-01 in a timezone), but TimeZone.getOffset() expect unix timestamp, the result could be off by one hour (in Daylight Saving Time (DST) or not). This PR change to use best effort approximate of posix timestamp to lookup the offset. In the event of changing of DST, Some time is not defined (for example, 2016-03-13 02:00:00 PST), or could lead to multiple valid result in UTC (for example, 2016-11-06 01:00:00), this best effort approximate should be enough in practice. ## How was this patch tested? Added regression tests. Author: Davies Liu <davies@databricks.com> Closes #13652 from davies/fix_timezone.
Diffstat (limited to 'repl/scala-2.11/src')
0 files changed, 0 insertions, 0 deletions