I have found some details about the Julian calendar as follows:
The Julian date for 2006: JAN: 01:12:01:59 is 2453737.00138
245 represent the year digits for year 2006
3737 represent the date fir 1 Jan
..00138 represents the time for 12:01:59
Julian date change as per every day 12 noon it increase one digit in
it.
As per ref from
http://www.aavso.org/observing/aids/jdcalendar.shtml
Also chk this calendar where Julian date is 20. October 2006 for 02
November 2006
As per ref from
http://www.calendar.sk/julian_calendar-en.php
I have tried the pure "GregorianCalendar" class from jdk1.4 API and
its setGregorianChange method but not getting as per the expected
Julian date format. Using the "setGregorianChange()" i have setting
the cutover date to Long.MAX_VALUE it means GregorianCalendar now have
to act as per the Julian calendar ...so after setting the cutover date
it return me changed date using "getGregorianChange()" but that was
not the Julian date of the current date...as expected or as per above
both scenario. Even though the last two digits are nowhere equal to the
actual Julian date.
Program
GregorianCalendar cal = new GregorianCalendar();
cal.setGregorianChange(new Date(Long.MAX_VALUE)); // setting the
calendar to act as a pure Julian calendar.
// cal.set(Calendar.DATE, new Date().getDate()); // seting the current
date
// Date todayJD = cal.getGregorianChange(); // getting the changed date
after the setGregorianChange
Date todayJD = cal.getTime(); // getting the calculated time of
today's Julian date
SimpleDateFormat sdfJulianDate = new SimpleDateFormat("yyDDD");
SimpleDateFormat sdfJuliandayOfYear = new SimpleDateFormat("DDD");
System.out.println("today Date = " + new Date());
System.out.println("Today as julian date = " +
sdfJulianDate.format(todayJD));
System.out.println("Today as day of year = " +
sdfJuliandayOfYear.format(todayJD));
OUTPUT:
USING : Date todayJD = cal.getGregorianChange();
Today Date = Thu Nov 02 15:17:05 IST 2006
Today as julian date = 94229
Today as day of year = 229
USING : cal.set(Calendar.DATE, new Date().getDate());
Today Date = Thu Nov 02 15:19:22 IST 2006
Today as julian date = 06319
Today as day of year = 319
USING : Date todayJD = cal.getTime();
Today Date = Thu Nov 02 15:17:59 IST 2006
Today as julian date = 06306
Today as day of year = 306
There is one another concept i found to get the Julian day of the year
as per the Julian day chart mention on nasa site
(
http://angler.larc.nasa.gov/armsgp/JulianDayChart.html) and i m
getting the moth of the year that is 306 for nov 02 2006 using
getTime() method in above code then the out put is right for Julian
day. But it was not as per the expected Julian date format. So in
conclusion we can only able to retrieve the day of year for the Julian
calendar. hope their will be a solution for this problem in java api
.....else we allways have to depend upon the third party api that was
not accepteble some times.....
Kindly chk chart on the site
http://angler.larc.nasa.gov/armsgp/JulianDayChart.html
http://weather.uwaterloo.ca/julian.html
http://www.fs.fed.us/raws/book/julian.shtml
Thanks,
Tushar