Date to gregorian Format

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ravireddy25
Participant
Posts: 59
Joined: Wed Dec 31, 2008 5:49 am

Date to gregorian Format

Post by ravireddy25 »

HI,
I have to convert Date format to Gregorian format, can any one suggest me how to do this, i searched but i didnt get the answers
Any suggestion is appreciated,

Thanks
Ravi
Ravi
ravireddy25
Participant
Posts: 59
Joined: Wed Dec 31, 2008 5:49 am

Re: Date to gregorian Format

Post by ravireddy25 »

ravireddy25 wrote:HI,
I have to convert Date format to Gregorian format, can any one suggest me how to do this, i searched but i didnt get the answers
Any suggestion is appreciated,

Thanks
Ravi
Hi,
I want the calender date to gregorian date
Ex:2005-08-15 to 38578

Thanks in Advance
Ravi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need to know the "day zero" for your particular date format. The default is 1967-12-31. Iconv(InLink.TheDate, "DYMD") will convert into what you've called a Gregorian date with 1967-12-31 converting to 0.

If this is not your day zero, simply take the Iconv() of your day zero and perform simple arithmetic to use your base date.

Look at some of the supplied Transforms that use a base date of 1970-01-01.

This reply assumes you are using a server job (as marked).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply