Jean Meeus's Astronomical Algorithms (as well as the related book Astronomical Formulæ for Calculators) is what you should start looking at whenever you need to deal with algorithms for quantities of astronomical interest.
For instance, here is a translation of Meeus's method for the Julian Date:
Options[jd] = {"Calendar" -> "Gregorian"};
jd[{yr_Integer, mo_Integer, da_?NumericQ, rest__}, opts : OptionsPattern[]] :=
Module[{y = yr, m = mo, h}, If[m < 3, y--; m += 12];
h = Switch[OptionValue["Calendar"],
"Gregorian", (Quotient[#, 4] - # + 2) &[Quotient[y, 100]],
"Julian", 0,
_, Return[$Failed]];
Floor[365.25 y] + Floor[30.6001 (m + 1)] + da + FromDMS[{rest}]/24 + 1720994.5 + h
]
jd[{yr_Integer, mo_Integer, da_?NumericQ}, opts : OptionsPattern[]] :=
jd[{yr, mo, da, 0, 0, 0}, opts]
jd[opts : OptionsPattern[]] := jd[DateList[], opts]
Some examples:
jd[{1957, 10, 4}] // InputForm
2.4361155*^6
jd[{1977, 4, 26}] // InputForm
2.4432595*^6
If you're sure you'll only be dealing with dates in the Gregorian calendar, one could use AbsoluteTime[] to compute JD, like so:
jd[args___] := AbsoluteTime[args]/86400 + 2.4150205*^6
Here's a short routine for Greenwich mean sidereal time (in {hours, minutes, seconds} format), based on formulæ given here:
GMST[{yr_Integer, mo_Integer, da_?NumericQ, rest__}, opts : OptionsPattern[]] :=
DMSList[Mod[6.697374558 + 0.06570982441908 (jd[{yr, mo, da}, opts] - 2.451545*^6) +
1.00273790935 FromDMS[{rest}] +
0.000026 ((jd[{yr, mo, da, rest}, opts] - 2.451545*^6)/36525)^2, 24]]
GMST[{yr_Integer, mo_Integer, da_?NumericQ}, opts : OptionsPattern[]] :=
GMST[{yr, mo, da, 0, 0, 0}, opts]
GMST[opts : OptionsPattern[]] := GMST[DateList[], opts]
Some examples:
GMST[{1987, 4, 10, 19, 21, 0}]
{8, 34, 57.089598878778816}
GMST[{2001, 10, 3, 6, 30, 0}]
{7, 18, 8.328661911859285}
One could use the output of FindGeoLocation[] to adjust the value of GMST[] to the corresponding local mean sidereal time, of course. I'll leave that as an exercise (the method needed is given in the USNO link I gave).
Getting the apparent sidereal time from the mean sidereal time requires a rather complicated correction term involving a series of trigonometric functions (the so-called equation of equinoxes). Here's a bunch of routines for computing Greenwich apparent sidereal time:
(* IAU 2000B coefficients (77 terms); from http://dx.doi.org/10.1023/A:1021762727016 *)
$nuϕcoeffs = {{0, 0, 0, 0, 1}, {0, 0, 2, -2, 2}, {0, 0, 2, 0, 2}, {0, 0, 0, 0, 2},
{0, 1, 0, 0, 0}, {0, 1, 2, -2, 2}, {1, 0, 0, 0, 0}, {0, 0, 2, 0, 1},
{1, 0, 2, 0, 2}, {0, -1, 2, -2, 2}, {0, 0, 2, -2, 1}, {-1, 0, 2, 0, 2},
{-1, 0, 0, 2, 0}, {1, 0, 0, 0, 1}, {-1, 0, 0, 0, 1}, {-1, 0, 2, 2, 2},
{1, 0, 2, 0, 1}, {-2, 0, 2, 0, 1}, {0, 0, 0, 2, 0}, {0, 0, 2, 2, 2},
{0, -2, 2, -2, 2}, {-2, 0, 0, 2, 0}, {2, 0, 2, 0, 2}, {1, 0, 2, -2, 2},
{-1, 0, 2, 0, 1}, {2, 0, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 1, 0, 0, 1},
{-1, 0, 0, 2, 1}, {0, 2, 2, -2, 2}, {0, 0, -2, 2, 0}, {1, 0, 0, -2, 1},
{0, -1, 0, 0, 1}, {-1, 0, 2, 2, 1}, {0, 2, 0, 0, 0}, {1, 0, 2, 2, 2},
{-2, 0, 2, 0, 0}, {0, 1, 2, 0, 2}, {0, 0, 2, 2, 1}, {0, -1, 2, 0, 2},
{0, 0, 0, 2, 1}, {1, 0, 2, -2, 1}, {2, 0, 2, -2, 2}, {-2, 0, 0, 2, 1},
{2, 0, 2, 0, 1}, {0, -1, 2, -2, 1}, {0, 0, 0, -2, 1}, {-1, -1, 0, 2, 0},
{2, 0, 0, -2, 1}, {1, 0, 0, 2, 0}, {0, 1, 2, -2, 1}, {1, -1, 0, 0, 0},
{-2, 0, 2, 0, 2}, {3, 0, 2, 0, 2}, {0, -1, 0, 2, 0}, {1, -1, 2, 0, 2},
{0, 0, 0, 1, 0}, {-1, -1, 2, 2, 2}, {-1, 0, 2, 0, 0}, {0, -1, 2, 2, 2},
{-2, 0, 0, 0, 1}, {1, 1, 2, 0, 2}, {2, 0, 0, 0, 1}, {-1, 1, 0, 1, 0},
{1, 1, 0, 0, 0}, {1, 0, 2, 0, 0}, {-1, 0, 2, -2, 1}, {1, 0, 0, 0, 2},
{-1, 0, 0, 1, 0}, {0, 0, 2, 1, 2}, {-1, 0, 2, 4, 2}, {-1, 1, 0, 1, 1},
{0, -2, 2, -2, 1}, {1, 0, 2, 2, 1}, {-2, 0, 2, 2, 2}, {-1, 0, 0, 0, 2},
{1, 1, 2, -2, 2}};
$Δψcoeffs = {{-172064161, -174666, 33386}, {-13170906, -1675, 13696},
{-2276413, -234, 2796}, {2074554, 207, -698},
{1475877, -3633, 11817}, {-516821, 1226, -524},
{711159, 73, -872}, {-387298, -367, 380}, {-301461, -36, 816},
{215829, -494, 111}, {128227, 137, 181}, {123457, 11, 19},
{156994, 10, -168}, {63110, 63, 27}, {-57976, -63, -189},
{-59641, -11, 149}, {-51613, -42, 129}, {45893, 50, 31},
{63384, 11, -150}, {-38571, -1, 158}, {32481, 0, 0},
{-47722, 0, -18}, {-31046, -1, 131}, {28593, 0, -1},
{20441, 21, 10}, {29243, 0, -74}, {25887, 0, -66},
{-14053, -25, 79}, {15164, 10, 11}, {-15794, 72, -16},
{21783, 0, 13}, {-12873, -10, -37}, {-12654, 11, 63},
{-10204, 0, 25}, {16707, -85, -10}, {-7691, 0, 44},
{-11024, 0, -14}, {7566, -21, -11}, {-6637, -11, 25},
{-7141, 21, 8}, {-6302, -11, 2}, {5800, 10, 2},
{6443, 0, -7}, {-5774, -11, -15}, {-5350, 0, 21},
{-4752, -11, -3}, {-4940, -11, -21}, {7350, 0, -8},
{4065, 0, 6}, {6579, 0, -24}, {3579, 0, 5}, {4725, 0, -6},
{-3075, 0, -2}, {-2904, 0, 15}, {4348, 0, -10}, {-2878, 0, 8},
{-4230, 0, 5}, {-2819, 0, 7}, {-4056, 0, 5}, {-2647, 0, 11},
{-2294, 0, -10}, {2481, 0, -7}, {2179, 0, -2}, {3276, 0, 1},
{-3389, 0, 5}, {3339, 0, -13}, {-1987, 0, -6}, {-1981, 0, 0},
{4026, 0, -353}, {1660, 0, -5}, {-1521, 0, 9}, {1314, 0, 0},
{-1283, 0, 0}, {-1331, 0, 8}, {1383, 0, -2}, {1405, 0, 4},
{1290, 0, 0}};
(* Coefficients of "complementary terms" for equation of equinoxes (12 terms);
from IERS 2010 conventions *)
$eeAcoeffs =
{2640.96, 63.52, 11.75, 11.21, -4.55, 2.02, 1.98, -1.72, -1.41, -1.26, -.63, -.63};
$eeϕcoeffs = {{0, 0, 0, 0, 1}, {0, 0, 0, 0, 2}, {0, 0, 2, -2, 3},
{0, 0, 2, -2, 1}, {0, 0, 2, -2, 2}, {0, 0, 2, 0, 3},
{0, 0, 2, 0, 1}, {0, 0, 0, 0, 3}, {0, 1, 0, 0, 1},
{0, 1, 0, 0, -1}, {1, 0, 0, 0, 1}, {1, 0, 0, 0, -1}};
(* mean obliquity of the ecliptic ε; formula 5.12 from USNO Circular 179 *)
MeanEclipticObliquity[args___] := Module[{T},
T = (jd[args] - 2451545)/36525;
(84381.406 + T (-46.836769 + T (-0.0001831 + T (0.0020034 +
T (-5.76*^-7 - 4.34*^-8 T)))))/3600
]
EquationOfEquinoxes[args___] :=
Module[{T, ℓ☽, ℓ☉, ℱ, \[ScriptCapitalD], Ω, ϕterms},
T = (jd[args] - 2451545)/36525;
(*
ℓ☽ - mean lunar anomaly;
ℓ☉ - mean solar anomaly;
ℱ - mean lunar argument of latitude;
\[ScriptCapitalD] - mean lunar elongation;
Ω - mean longitude of lunar ascending node;
*)
{ℓ☽, ℓ☉, ℱ, \[ScriptCapitalD], Ω} =
{485868.249036 + T (1.7179159232178*^9 + T (31.8792 + T (0.051635 - 0.0002447 T))),
1.28710479305*^6 + T (1.295965810481*^8 + T (-0.5532 + T (0.000136 - 0.00001149 T))),
335779.526232 + T (1.7395272628478*^9 + T (-12.7512 + T (-0.001037 + 4.17*^-6 T))),
1.07226070369*^6 + T (1.602961601209*^9 + T (-6.3706 + T (0.006593 - 0.00003169 T))),
450160.398036 + T (-6.9628905431*^6 + T (7.4722 + T (0.007702 - 0.00005939 T)))};
ϕterms = $nuϕcoeffs.{ℓ☽, ℓ☉, ℱ, \[ScriptCapitalD], Ω} Degree/3600;
(Total[((#1 + #2 T) Sin[#4] + #3 Cos[#4]) & @@@ MapThread[Append, {$Δψcoeffs, ϕterms}],
Method -> "CompensatedSummation"]/3.6*^10)
Cos[MeanEclipticObliquity[args] Degree] +
$eeAcoeffs.Sin[$eeϕcoeffs.{ℓ☽, ℓ☉, ℱ, \[ScriptCapitalD], Ω} Degree/3600]/3.6*^9
]
GAST[{yr_Integer, mo_Integer, da_?NumericQ, rest__}, opts : OptionsPattern[]] :=
DMSList[Mod[6.697374558 + 0.06570982441908 (jd[{yr, mo, da}, opts] - 2.451545*^6) +
1.00273790935 FromDMS[{rest}] +
0.000026 ((jd[{yr, mo, da, rest}, opts] - 2.451545*^6)/36525)^2 +
EquationOfEquinoxes[{yr, mo, da, rest}]/15, 24]]
GAST[{yr_Integer, mo_Integer, da_?NumericQ}, opts : OptionsPattern[]] :=
GAST[{yr, mo, da, 0, 0, 0}, opts]
GAST[opts : OptionsPattern[]] := GAST[DateList[], opts]
An example:
GAST[{2012, 10, 1, 0, 0, 0}] // InputForm
{0, 40, 31.48976449269867}