public static double greenwichSiderealTime(double julianDate,GregorianCalendar time){
  double T=(julianDate - 2451545.0) / 36525.0;
  double T0=6.697374558 + (T * (2400.051336 + (T + 2.5862E-5)));
  T0%=24.0;
  if (T0 < 0) {
    T0+=24.0;
  }
  double UT=time.get(Calendar.HOUR_OF_DAY) + (time.get(Calendar.MINUTE) + time.get(Calendar.SECOND) / 60.0) / 60.0;
  T0+=UT * 1.002737909;
  T0%=24.0;
  if (T0 < 0) {
    T0+=24.0;
  }
  return T0;
}

public static double greenwichSiderealTime ( double julianDate , GregorianCalendar time ) { double T = ( julianDate - 2451545.0 ) / 36525.0 ; double T0 = 6.697374558 + ( T * ( 2400.051336 + ( T + 2.5862E-5 ) ) ) ; T0 %= 24.0 ; if ( T0 < 0 ) { T0 += 24.0 ; } double UT = time . get ( Calendar . HOUR_OF_DAY ) + ( time . get ( Calendar . MINUTE ) + time . get ( Calendar . SECOND ) / 60.0 ) / 60.0 ; T0 += UT * 1.002737909 ; T0 %= 24.0 ; if ( T0 < 0 ) { T0 += 24.0 ; } return T0 ; }
calculate the greenwich sidereal time ( gst ) . from duffett - smith , chapter 12 .
