Question

I am trying to adjust a code at work, the issue I face is with JAVA script using Eclipse. I cannot understand how Julian Date or Number is there calculated or chosen because I need to adjust it.

Any suggestions on this brainer?

An example would be:

jToday=2456324.5

Thank you very much for your input!

Was it helpful?

Solution

You can use Joda lib to convert Julian days to java date

DateTime dt =  new DateTime(DateTimeUtils.fromJulianDay(2456324.5));

Julian date - number before decimal point represent number of days since noon on January 1, 4713 BC, and after decimal point fraction of the day; For example, the Julian Date for 1.1.2013 UT 0:30:00, is 2456293.520833

OTHER TIPS

You can use joda-time to convert between a Julian date like the one you have and any other calendar:

http://joda-time.sourceforge.net/cal_julian.html

You can also use this function:

http://www.rgagnon.com/javadetails/java-0506.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top