public static Date calculateGregorianDate(double jd){
  int l=(int)jd + 68569;
  int n=(4 * l) / 146097;
  l=l - (146097 * n + 3) / 4;
  int i=(4000 * (l + 1)) / 1461001;
  l=l - (1461 * i) / 4 + 31;
  int j=(80 * l) / 2447;
  int d=l - (2447 * j) / 80;
  l=j / 11;
  int m=j + 2 - 12 * l;
  int y=100 * (n - 49) + i + l;
  double fraction=jd - Math.floor(jd);
  double dHours=fraction * 24.0;
  int hours=(int)dHours;
  double dMinutes=(dHours - hours) * 60.0;
  int minutes=(int)dMinutes;
  int seconds=(int)((dMinutes - minutes) * 60.0);
  Calendar cal=Calendar.getInstance(TimeZone.getTimeZone("UT"));
  cal.set(y,m - 1,d,hours + 12,minutes,seconds);
  return cal.getTime();
}

public static Date calculateGregorianDate ( double jd ) { int l = ( int ) jd + 68569 ; int n = ( 4 * l ) / 146097 ; l = l - ( 146097 * n + 3 ) / 4 ; int i = ( 4000 * ( l + 1 ) ) / 1461001 ; l = l - ( 1461 * i ) / 4 + 31 ; int j = ( 80 * l ) / 2447 ; int d = l - ( 2447 * j ) / 80 ; l = j / 11 ; int m = j + 2 - 12 * l ; int y = 100 * ( n - 49 ) + i + l ; double fraction = jd - Math . floor ( jd ) ; double dHours = fraction * 24.0 ; int hours = ( int ) dHours ; double dMinutes = ( dHours - hours ) * 60.0 ; int minutes = ( int ) dMinutes ; int seconds = ( int ) ( ( dMinutes - minutes ) * 60.0 ) ; Calendar cal = Calendar . getInstance ( TimeZone . getTimeZone ( "UT" ) ) ; cal . set ( y , m - 1 , d , hours + 12 , minutes , seconds ) ; return cal . getTime ( ) ; }
convert the given julian day to gregorian date ( in ut time zone ) . based on the formula given in the explanitory supplement to the astronomical almanac , pg 604 .
