You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Deepak Reddy <dr...@couponsinc.com> on 2011/11/02 19:02:32 UTC

datetime conversion to a specific timezone

Is there a way to convert the nominal time from UTC to say PST/PDT within oozie workflow.

Thanks,
DR

Re: datetime conversion to a specific timezone

Posted by Mohammad Islam <mi...@yahoo.com>.
Hi Deepak,
In that case, you need to change your format string. 'Z' stands for UTC.

Would mind to check this link to find the correct TZ string?
http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html


I believe it might be 'zzzz'.

Regards,
Mohammad


________________________________
From: Deepak Reddy <dr...@couponsinc.com>
To: "oozie-users@incubator.apache.org" <oo...@incubator.apache.org>; Mohammad Islam <mi...@yahoo.com>
Sent: Wednesday, November 2, 2011 2:05 PM
Subject: RE: datetime conversion to a specific timezone

Hi Mohammad,

I tried the following in my coordinator.xml file (the job runs in UTC) 

${coord:formatTime(coord:nominalTime(), 'yyyy-MM-dd HH:mm:ss z')}

It actually returns 2011-11-02 00:30:00 UTC which is not what I am expecting.

If the nominal time is 2011-11-02 00:30:00 UTC then I would like to pass 2011-11-01 17:30:00 PST to my job from the oozie workflow.

Thank you,
DR

-----Original Message-----
From: Mohammad Islam [mailto:mislam77@yahoo.com] 
Sent: Wednesday, November 02, 2011 11:35 AM
To: oozie-users@incubator.apache.org
Subject: Re: datetime conversion to a specific timezone

Deepak,
Can you try this?
http://yahoo.github.com/oozie/releases/3.1.0/CoordinatorFunctionalSpec.html#a6.8.2._coord:formatTimeString_ts_String_format_EL_Function_since_Oozie_2.3.2

Basically use {coord:formatTime(oord:nominalTime(), String format)} . In the 'format' string specify the new TZ.

I never tested that, but it should work.

Regards,
Mohammad




________________________________
From: Deepak Reddy <dr...@couponsinc.com>
To: "oozie-users@incubator.apache.org" <oo...@incubator.apache.org>
Sent: Wednesday, November 2, 2011 11:02 AM
Subject: datetime conversion to a specific timezone

Is there a way to convert the nominal time from UTC to say PST/PDT within oozie workflow.

Thanks,
DR

RE: datetime conversion to a specific timezone

Posted by Deepak Reddy <dr...@couponsinc.com>.
Hi Mohammad,

I tried the following in my coordinator.xml file (the job runs in UTC) 

${coord:formatTime(coord:nominalTime(), 'yyyy-MM-dd HH:mm:ss z')}

It actually returns 2011-11-02 00:30:00 UTC which is not what I am expecting.

If the nominal time is 2011-11-02 00:30:00 UTC then I would like to pass 2011-11-01 17:30:00 PST to my job from the oozie workflow.

Thank you,
DR

-----Original Message-----
From: Mohammad Islam [mailto:mislam77@yahoo.com] 
Sent: Wednesday, November 02, 2011 11:35 AM
To: oozie-users@incubator.apache.org
Subject: Re: datetime conversion to a specific timezone

Deepak,
Can you try this?
http://yahoo.github.com/oozie/releases/3.1.0/CoordinatorFunctionalSpec.html#a6.8.2._coord:formatTimeString_ts_String_format_EL_Function_since_Oozie_2.3.2

Basically use {coord:formatTime(oord:nominalTime(), String format)} . In the 'format' string specify the new TZ.

I never tested that, but it should work.

Regards,
Mohammad




________________________________
From: Deepak Reddy <dr...@couponsinc.com>
To: "oozie-users@incubator.apache.org" <oo...@incubator.apache.org>
Sent: Wednesday, November 2, 2011 11:02 AM
Subject: datetime conversion to a specific timezone

Is there a way to convert the nominal time from UTC to say PST/PDT within oozie workflow.

Thanks,
DR

Re: datetime conversion to a specific timezone

Posted by Mohammad Islam <mi...@yahoo.com>.
Deepak,
Can you try this?
http://yahoo.github.com/oozie/releases/3.1.0/CoordinatorFunctionalSpec.html#a6.8.2._coord:formatTimeString_ts_String_format_EL_Function_since_Oozie_2.3.2

Basically use {coord:formatTime(oord:nominalTime(), String format)} . In the 'format' string specify the new TZ.

I never tested that, but it should work.

Regards,
Mohammad




________________________________
From: Deepak Reddy <dr...@couponsinc.com>
To: "oozie-users@incubator.apache.org" <oo...@incubator.apache.org>
Sent: Wednesday, November 2, 2011 11:02 AM
Subject: datetime conversion to a specific timezone

Is there a way to convert the nominal time from UTC to say PST/PDT within oozie workflow.

Thanks,
DR