Page 1 of 1

Date from Julian Date CCYYDDD

Posted: Mon Jul 21, 2008 8:11 am
by harshada
Hi,

I need to convert the Julian Date to date of format 'YYYYMMDD'.
I read in the forum that the DateFromJulianDay should work and give the date in format 'YYYY-MM-DD'.

My input date is 2008354 (CCYYDDD)
so this should be 2008-12-19. I used
DateFromJulianDay(StringToDecimal(Trim(INP_2.DATEP)))
but got the output as '0786-08-02' which is incorrect

The input is coming in from the file and read as char(7).


Can anyone help me why I am getting the output like this.

Thanks,
Harshada

Posted: Mon Jul 21, 2008 9:33 am
by harshada
hey...

its resolved...

Just used StringToDate(Trim(INP_2.DATEP),"%yyyy%ddd")

Thanks anyways.. if anyone was trying over this one

Harshada

Posted: Mon Jul 21, 2008 9:47 am
by OddJob
harshada wrote:
Thanks anyways.. if anyone was trying over this one

Harshada
That'll be me then!

For future info, this format of date is called an Ordinal Date, not Julian Date.

Posted: Tue Jul 22, 2008 1:44 am
by harshada
ohh sorry about that.. thanks for letting me know.

:)