You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Olaf Collider <ol...@gmail.com> on 2016/08/28 19:59:51 UTC

Pig: how to convert a unix timestamp into local time using ToDate?

Dear all,

In my data, I have a unix timestamp in seconds (such as 1294778181)
that I would like to convert to UTC time and  'US/Eastern'
(considering any DST) using the ToDate Pig function.

The final purpose is to generate a string variable that contains the
day (such as 02/01/2016) in both GMT and local time)

I have two related issues:

1) How can I do that in Pig?

2) How can I check that my version of Pig contains this important fix
(https://issues.apache.org/jira/browse/PIG-4267).
When I type --version I get pig 12.0 Cdh 5.5 compiled november 2015.
Am I on the safe side?



Many thanks and keep up the great work with Pig!

Thanks