cancel
Showing results for 
Search instead for 
Did you mean: 

Current date to Julian Date in Crystal reports

Former Member
0 Kudos

Good Morning Everybody,

Does anyone know about Julian date?

Its a date format where it has something to do with the date count. Can anybody tell me if there is a function in crystal reports or if somebody has a formula which works for that. I need current date converted to the julian date.

for more information on Julian dates :

http://amsu.cira.colostate.edu/julian.html

http://astronomy.villanova.edu/links/jd.htm

It would be great if somebody could help me with this.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Vasu,

Crystal Reports does not come with an in-built function for Julian Dates. There is however, a UFL called "UFLJUL" that can be downloaded from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006019242008E/ufljul.exe

Unzip the file and copy the 2 dlls (U2LJUL.DLL and UFLJUL.DLL) to (assuming you're using CR 2008)

C:\Programs Files\Business Objects\ Business Objects Enterprise 12.0\win32_x86

If everything goes well, there will be two functions available in the Formula Editor Window under "Functions" called

DateToJulian(date) and

JulianToDate(n)

Hope this helps!

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Nrupali,

But the formual doesnt work. The expected date have to be 2456238 but it is showing 2445675

Former Member
0 Kudos

Hi Vasu,

Check if this works fine.

numberVar k:=year(CurrentDateTime);
numberVar m:=month(CurrentDateTime);
numberVar l:=day(CurrentDateTime);
numberVar JD;

JD:=l-32075+1461*(k+4800+(m-14)/12)/4+367*(m-2-(m-14)/12*12)/12-3*((k+4900+(m-14)/12)/100)/4;

- Nrupal

Former Member
0 Kudos

Thanks Abhilash And nrupali...

You Guys saved my day.

Former Member
0 Kudos

Hi Vasu,

To convert the current date to Julian Date create a formula as:

numberVar k:=year(CurrentDateTime);

numberVar m:= month(CurrentDateTime);

numberVar l:=day(CurrentDateTime);

timeVar ut:= time(CurrentDateTime);

numberVar ut1:= hour(ut)+(Minute(ut)/60)+(Second(ut)/60);

numberVar JD;

JD:= (367*K) - Truncate(7*(k+Truncate((m+9)/12)/4))+ Truncate((275*m)/9)+l+ 1721013.5+(ut1/24)- (0.5*sgn((100*K)+M-190002.5))+ 0.5 ;

Hope this helps!

- Nrupal