Page 1 of 1

Julian Dates to Regular Dates

Posted: Fri Aug 20, 2004 12:07 pm
by mannoo19
Hi,,
Can someone help me by telling, how can we convert julian dates to regular dates..
Thanks in advance..

Posted: Fri Aug 20, 2004 12:20 pm
by bryan
there are many posts which covered this topic


would appreciate any senior validate my answer

oconv(iconv(JulianDate,"DYJ"),"D4-YMD[4,2,2]")



You could have wrote whats the format of your regular date.

hope that works

Posted: Fri Aug 20, 2004 12:24 pm
by mannoo19
Thanks Bryan,,
Let me try if this thing works,,
Thanks..

Posted: Fri Aug 20, 2004 12:53 pm
by Shaina Austin
Hi,

If your format of output date is YYYYMMDD, this one works

DateGenericToTimeStamp(SourceLink)[1,8]

This converts to a Time stamp and you can just pickup the date.

I am not sure if this is the right way to do it. But it works.

Posted: Fri Aug 20, 2004 2:40 pm
by bryan
It works. Its easy than knowing the whole D conversion code.

Or

we could also use the

DateGenericToODBC(linkname.input)

It ouputs date in the format YYYY-MM-DD.

Thanks Shaina

Posted: Fri Aug 20, 2004 6:10 pm
by ray.wurlod
All of the previous responses are correct if, by "Julian dates", you mean a date containing the ordinal number of the day within the year.

If you mean some other form if Julian date, such as the ordinal number of the day in the century, or since some given "day zero", then techniques are similar but not identical. For example, there are some SDK transforms for handling dates based on day zero being 01/01/1970. Internally, DataStage uses a day zero of 31 December 1967.

Posted: Mon Aug 23, 2004 8:41 am
by mannoo19
Hi ,
I have tried using :
DateGenericToTimeStamp(SourceLink)[1,8]
but i get the error message as :
"nput value not long enough for date format"

the input value is actually the julian date : 94070...
can someone help ..
thanks,

Posted: Mon Aug 23, 2004 4:43 pm
by ray.wurlod
Iconv(94070, "DYJ") or Iconv(94070, "D2YJ")