hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HIVE-6009) Add from_unixtime UDF that has controllable Timezone
Date Wed, 08 Feb 2017 05:57:42 GMT

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

Alexander Pivovarov edited comment on HIVE-6009 at 2/8/17 5:57 AM:
-------------------------------------------------------------------

you can convert bigint to UTC timestamp and then convert UTC timestamp to GMT-5 timestamp
(EST)

{code}
select from_unixtime(1293840000);
2010-12-31 16:00:00   // in Greenwich

select from_utc_timestamp(from_unixtime(1293840000), 'GMT-5');
2010-12-31 11:00:00   // in NYC
{code}


was (Author: apivovarov):
you can convert bigint to UTC timestamp and then convert UTC timestamp to GMT-5 timestamp
(EST)

{code}
select from_unixtime(1293840000);
2010-12-31 16:00:00   // in Greenwich

select from_utc_timestamp(from_unixtime(1293840000), 'GMT-5');
2010-12-31 11:00:00   // in NYC

> Add from_unixtime UDF that has controllable Timezone
> ----------------------------------------------------
>
>                 Key: HIVE-6009
>                 URL: https://issues.apache.org/jira/browse/HIVE-6009
>             Project: Hive
>          Issue Type: Improvement
>          Components: CLI
>    Affects Versions: 0.10.0
>         Environment: CDH4.4
>            Reporter: Johndee Burks
>            Priority: Trivial
>
> Currently the from_unixtime UDF takes into a account timezone of the system doing the
transformation. I think that implementation is good, but it would be nice to include or change
the current UDF to have a configurable timezone. 
> It would be useful for looking at timestamp data from different regions in the native
region's timezone. 
> Example: 
> from_unixtime(unix_time, format, timezone)
> from_unixtime(1293840000, dd MMM yyyy, GMT-5)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message