You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Chaoyu Tang (JIRA)" <ji...@apache.org> on 2016/07/11 14:39:11 UTC

[jira] [Commented] (HIVE-14161) from_utc_timestamp()/to_utc_timestamp return incorrect results with EST

    [ https://issues.apache.org/jira/browse/HIVE-14161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15370893#comment-15370893 ] 

Chaoyu Tang commented on HIVE-14161:
------------------------------------

It seems to related to TimeZone ID (EST) used. For a given timezone like GMT-5 there might be multiple associated timezone IDs such as EST, EST5EDT, America/New_York, US/Eastern etc. These IDs differ in DST (daylight saving time) behavior. EST does not factor in DTS, but EST5EDT does. So:
SELECT to_utc_timestamp('2016-06-30 09:00:00', 'EST'); still returns 2016-06-30 14:00:00.0 
and
SELECT to_utc_timestamp('2016-06-30 09:00:00', 'EST5EDT'); returns 2016-06-30 13:00:00
SELECT from_utc_timestamp('2016-06-30 13:00:00', 'EST5EDT'); returns 2016-06-30 09:00:00

> from_utc_timestamp()/to_utc_timestamp return incorrect results with EST
> -----------------------------------------------------------------------
>
>                 Key: HIVE-14161
>                 URL: https://issues.apache.org/jira/browse/HIVE-14161
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Chaoyu Tang
>            Assignee: Chaoyu Tang
>
> {code}
> hive> SELECT to_utc_timestamp('2016-06-30 06:00:00', 'PST'); 
> OK
> 2016-06-30 13:00:00  ==>Correct, UTC is 7 hours ahead of PST
> Time taken: 1.674 seconds, Fetched: 1 row(s)
> hive> SELECT to_utc_timestamp('2016-06-30 08:00:00', 'CST');
> OK
> 2016-06-30 13:00:00  ==>Correct, UTC is 5 hours ahead of CST
> Time taken: 1.776 seconds, Fetched: 1 row(s)
> hive> SELECT to_utc_timestamp('2016-06-30 09:00:00', 'EST');
> OK
> 2016-06-30 14:00:00  ==>Wrong, UTC should be 4 hours ahead of EST
> Time taken: 1.686 seconds, Fetched: 1 row(s)
> hive> select from_utc_timestamp('2016-06-30 14:00:00', 'EST');
> OK
> 2016-06-30 09:00:00  ==>Wrong, UTC should be 4 hours ahead of EST
> {code}
> It might be something related to daylight savings time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)