<p>I have often seen programs use a Julian century, so the 36625 is probably the number of sidereal days in a century, whereas 36525 is the number of calendar days in a century (<a href="https://en.wikipedia.org/wiki/Julian_year_(astronomy)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Julian_year_(astronomy)</a>)</p>

<p>Sidereal time generally runs uniformly forward or backward :-). I think the calculation will work prior to 2000. I am not going to type it in to test it, but since you have (or will), you can test it. The sidereal time should be close to the same value for the same time and day regardless of the year.</p>

CC BY-SA 3.0
2017-07-29T20:17:06.210Z
U R right. It is J. century not year. Here I made a test: [url]http://www.saecanet.com/calculation_page/000334_000463_horizontal%20coordinate_system.php[/url] 18.4306 East, 1911/12/22 - result: Julian Century=-0.88028747433265. My program result T = Julian Century = -0.880329
user1141649
CC BY-SA 3.0
2017-07-30T10:10:32.377Z
I have added the results of my test and updated the question.
user1141649
CC BY-SA 3.0
2017-07-30T21:09:38.117Z
Actually, the code calculates the sidereal time in degrees. Unless you converted it to hours, you should "mod" it with 360. Then you need to determine how "mod" works with negative numbers, but you probably just need to add 360 if the number is negative to put it in the proper range of 0 to 360.
JohnHoltz
CC BY-SA 3.0
2017-07-29T19:40:59.933Z
2017-07-30T17:02:57.020Z
2017-07-30T17:02:57.020Z
JohnHoltz
<p>I am creating program in C which is derived from Javascript Solar Radiation calculator based on a book <em>Guide to HTML, JavaScript and PHP: For Scientists and Engineers</em> By David R. Brooks. The original program calculates Sidereal time like this:</p>

<pre><code>  // Sidereal time (Theta0)
  double GMST = 280.46061837+360.98564736629*( i-&gt;JulianDate-2451545.);
  // Sidereal_time = GMST + 0.000387933*T2 - T3/38710000
  double Sidereal_time = GMST+0.000387933*T*T
       -T*T*T/38710000.;
  // Performance optimalizatuion of code for Sidereal=fmod(Sidereal,360.) or Sidereal%360
  double S_save=Sidereal_time/360.;
  if (S_save &lt; 0.) Sidereal_time = Sidereal_time-ceil(S_save)*360.;
  else Sidereal_time = Sidereal_time-floor(S_save)*360.;
  if (Sidereal_time &lt; 0.) Sidereal_time+=360.;
</code></pre>

<p>Where i->JulianDate is date/time specified by user which is converted to Julian date. As you can see this approach is based on 2451545.0 which is the equivalent of <code>January 1, 2000, at 12:00:00 UT</code> and <code>36525.0</code> is Julian Year. I am not sure why there is 36525 instead <code>365.25</code> (days of Julian Year). Can you explain this?</p>

<p>Once more the same code without comments:</p>

<pre><code>  double GMST = 280.46061837+360.98564736629*( i-&gt;JulianDate-2451545.);
  double Sidereal_time = GMST+0.000387933*T*T-T*T*T/38710000.;
  double S_save=Sidereal_time/360.;
  if (S_save &lt; 0.) 
     Sidereal_time = Sidereal_time-ceil(S_save)*360.;
  else 
     Sidereal_time = Sidereal_time-floor(S_save)*360.;
  if (Sidereal_time &lt; 0.) 
     Sidereal_time+=360.;
</code></pre>

<p>Another question:</p>

<p>If I enter date older than January 1, 2000, at 12:00:00 UT, e.g. <strong>1945</strong>, will the sidereal time be correct? Or do I need to change the number <code>36525.0</code> to extend the range?</p>

<p>Yet, before the Sidereal time is calculated in the program there is this:
<code>double T=( i-&gt;JulianDate-2451545.0)/36525.0;</code> Which is similar thing.</p>

<p>Sidereal_time is used to calculate hour_angle which is used to calculate Sun's elevation and Solar Zenit Angle Z. Will this variables be affected when I type 1945 or older date in the program?</p>

<p><strong>EDIT:</strong>
I have added log to my program which printed values into file. I have tested the program for range 1990-2010. You can see that the SideReal time same as L0 (Geometric mean longitude) is negative number when the date is older than 2000/01/01 as defined in the program to calculate T. The difference of 10 years is cca 0.09999 of Julian century. </p>

<pre><code>Date:1990 1 1 12:0:0
Julian Century: -0.099986
L0 - geometric mean longitude of the sun:: -3319.117706
GMST: -1318039.123563
Sidereal time: -1318039.123559
Julian Date: 2447893.000000

Date:1991 1 1 12:0:0
Julian Century: -0.089993
L0 - geometric mean longitude of the sun:: -2959.356420
GMST: -1186279.362275
Sidereal time: -1186279.362271
Julian Date: 2448258.000000

Date:1992 1 1 12:0:0
Julian Century: -0.080000
L0 - geometric mean longitude of the sun:: -2599.595134
GMST: -1054519.600986
Sidereal time: -1054519.600983
Julian Date: 2448623.000000

Date:1993 1 1 12:0:0
Julian Century: -0.069979
L0 - geometric mean longitude of the sun:: -2238.848201
GMST: -922398.854050
Sidereal time: -922398.854048
Julian Date: 2448989.000000

Date:1994 1 1 12:0:0
Julian Century: -0.059986
L0 - geometric mean longitude of the sun:: -1879.086915
GMST: -790639.092761
Sidereal time: -790639.092760
Julian Date: 2449354.000000

Date:1995 1 1 12:0:0
Julian Century: -0.049993
L0 - geometric mean longitude of the sun:: -1519.325629
GMST: -658879.331472
Sidereal time: -658879.331472
Julian Date: 2449719.000000

Date:1996 1 1 12:0:0
Julian Century: -0.040000
L0 - geometric mean longitude of the sun:: -1159.564343
GMST: -527119.570184
Sidereal time: -527119.570183
Julian Date: 2450084.000000

Date:1997 1 1 12:0:0
Julian Century: -0.029979
L0 - geometric mean longitude of the sun:: -798.817409
GMST: -394998.823248
Sidereal time: -394998.823247
Julian Date: 2450450.000000

Date:1998 1 1 12:0:0
Julian Century: -0.019986
L0 - geometric mean longitude of the sun:: -439.056123
GMST: -263239.061959
Sidereal time: -263239.061959
Julian Date: 2450815.000000

Date:1999 1 1 12:0:0
Julian Century: -0.009993
L0 - geometric mean longitude of the sun:: -79.294836
GMST: -131479.300670
Sidereal time: -131479.300670
Julian Date: 2451180.000000

Date:2000 1 1 12:0:0
Julian Century: 0.000000
L0 - geometric mean longitude of the sun:: 280.466450
GMST: 280.460618
Sidereal time: 280.460618
Julian Date: 2451545.000000

Date:2001 1 1 12:0:0
Julian Century: 0.010021
L0 - geometric mean longitude of the sun:: 641.213384
GMST: 132401.207554
Sidereal time: 132401.207554
Julian Date: 2451911.000000

Date:2002 1 1 12:0:0
Julian Century: 0.020014
L0 - geometric mean longitude of the sun:: 1000.974670
GMST: 264160.968843
Sidereal time: 264160.968843
Julian Date: 2452276.000000

Date:2003 1 1 12:0:0
Julian Century: 0.030007
L0 - geometric mean longitude of the sun:: 1360.735957
GMST: 395920.730132
Sidereal time: 395920.730132
Julian Date: 2452641.000000

Date:2004 1 1 12:0:0
Julian Century: 0.040000
L0 - geometric mean longitude of the sun:: 1720.497244
GMST: 527680.491421
Sidereal time: 527680.491421
Julian Date: 2453006.000000

Date:2005 1 1 12:0:0
Julian Century: 0.050021
L0 - geometric mean longitude of the sun:: 2081.244178
GMST: 659801.238357
Sidereal time: 659801.238358
Julian Date: 2453372.000000

Date:2006 1 1 12:0:0
Julian Century: 0.060014
L0 - geometric mean longitude of the sun:: 2441.005465
GMST: 791560.999645
Sidereal time: 791560.999647
Julian Date: 2453737.000000

Date:2007 1 1 12:0:0
Julian Century: 0.070007
L0 - geometric mean longitude of the sun:: 2800.766751
GMST: 923320.760934
Sidereal time: 923320.760936
Julian Date: 2454102.000000

Date:2008 1 1 12:0:0
Julian Century: 0.080000
L0 - geometric mean longitude of the sun:: 3160.528038
GMST: 1055080.522223
Sidereal time: 1055080.522225
Julian Date: 2454467.000000

Date:2009 1 1 12:0:0
Julian Century: 0.090021
L0 - geometric mean longitude of the sun:: 3521.274973
GMST: 1187201.269159
Sidereal time: 1187201.269162
Julian Date: 2454833.000000

Date:2010 1 1 12:0:0
Julian Century: 0.100014
L0 - geometric mean longitude of the sun:: 3881.036260
GMST: 1318961.030447
Sidereal time: 1318961.030451
Julian Date: 2455198.000000
</code></pre>

<p><strong>EDIT2: fmod(GMST,24); fmod(Sidereal_time,24);</strong></p>

<pre><code>Date:1990 1 1 12:0:0
Julian Century: -0.099986
L0 - geometric mean longitude of the sun:: -3319.117706
GMST: -7.123563
Sidereal time: -7.123559
Julian Date: 2447893.000000

Date:1991 1 1 12:0:0
Julian Century: -0.089993
L0 - geometric mean longitude of the sun:: -2959.356420
GMST: -7.362275
Sidereal time: -7.362271
Julian Date: 2448258.000000

Date:1992 1 1 12:0:0
Julian Century: -0.080000
L0 - geometric mean longitude of the sun:: -2599.595134
GMST: -7.600986
Sidereal time: -7.600983
Julian Date: 2448623.000000

Date:1993 1 1 12:0:0
Julian Century: -0.069979
L0 - geometric mean longitude of the sun:: -2238.848201
GMST: -6.854050
Sidereal time: -6.854048
Julian Date: 2448989.000000

Date:1994 1 1 12:0:0
Julian Century: -0.059986
L0 - geometric mean longitude of the sun:: -1879.086915
GMST: -7.092761
Sidereal time: -7.092760
Julian Date: 2449354.000000

Date:1995 1 1 12:0:0
Julian Century: -0.049993
L0 - geometric mean longitude of the sun:: -1519.325629
GMST: -7.331472
Sidereal time: -7.331472
Julian Date: 2449719.000000

Date:1996 1 1 12:0:0
Julian Century: -0.040000
L0 - geometric mean longitude of the sun:: -1159.564343
GMST: -7.570184
Sidereal time: -7.570183
Julian Date: 2450084.000000

Date:1997 1 1 12:0:0
Julian Century: -0.029979
L0 - geometric mean longitude of the sun:: -798.817409
GMST: -6.823248
Sidereal time: -6.823247
Julian Date: 2450450.000000

Date:1998 1 1 12:0:0
Julian Century: -0.019986
L0 - geometric mean longitude of the sun:: -439.056123
GMST: -7.061959
Sidereal time: -7.061959
Julian Date: 2450815.000000

Date:1999 1 1 12:0:0
Julian Century: -0.009993
L0 - geometric mean longitude of the sun:: -79.294836
GMST: -7.300670
Sidereal time: -7.300670
Julian Date: 2451180.000000

Date:2000 1 1 12:0:0
Julian Century: 0.000000
L0 - geometric mean longitude of the sun:: 280.466450
GMST: 16.460618
Sidereal time: 16.460618
Julian Date: 2451545.000000

Date:2001 1 1 12:0:0
Julian Century: 0.010021
L0 - geometric mean longitude of the sun:: 641.213384
GMST: 17.207554
Sidereal time: 17.207554
Julian Date: 2451911.000000

Date:2002 1 1 12:0:0
Julian Century: 0.020014
L0 - geometric mean longitude of the sun:: 1000.974670
GMST: 16.968843
Sidereal time: 16.968843
Julian Date: 2452276.000000

Date:2003 1 1 12:0:0
Julian Century: 0.030007
L0 - geometric mean longitude of the sun:: 1360.735957
GMST: 16.730132
Sidereal time: 16.730132
Julian Date: 2452641.000000

Date:2004 1 1 12:0:0
Julian Century: 0.040000
L0 - geometric mean longitude of the sun:: 1720.497244
GMST: 16.491421
Sidereal time: 16.491421
Julian Date: 2453006.000000

Date:2005 1 1 12:0:0
Julian Century: 0.050021
L0 - geometric mean longitude of the sun:: 2081.244178
GMST: 17.238357
Sidereal time: 17.238358
Julian Date: 2453372.000000

Date:2006 1 1 12:0:0
Julian Century: 0.060014
L0 - geometric mean longitude of the sun:: 2441.005465
GMST: 16.999645
Sidereal time: 16.999647
Julian Date: 2453737.000000

Date:2007 1 1 12:0:0
Julian Century: 0.070007
L0 - geometric mean longitude of the sun:: 2800.766751
GMST: 16.760934
Sidereal time: 16.760936
Julian Date: 2454102.000000

Date:2008 1 1 12:0:0
Julian Century: 0.080000
L0 - geometric mean longitude of the sun:: 3160.528038
GMST: 16.522223
Sidereal time: 16.522225
Julian Date: 2454467.000000

Date:2009 1 1 12:0:0
Julian Century: 0.090021
L0 - geometric mean longitude of the sun:: 3521.274973
GMST: 17.269159
Sidereal time: 17.269162
Julian Date: 2454833.000000

Date:2010 1 1 12:0:0
Julian Century: 0.100014
L0 - geometric mean longitude of the sun:: 3881.036260
GMST: 17.030447
Sidereal time: 17.030451
Julian Date: 2455198.000000
</code></pre>

CC BY-SA 3.0
2017-07-29T18:21:58.840Z
It's "sidereal", not "sitereal" btw.
Phiteros
CC BY-SA 3.0
2017-07-29T21:37:55.280Z
The number 35625. does not appear in your code. It is unclear what you are refering to.
James K
CC BY-SA 3.0
2017-07-30T07:59:17.833Z
Some clever explanation of SideReal time https://www.youtube.com/watch?v=alnfOIWdp7E or this one https://www.youtube.com/watch?v=82p-DYgGFjI&feature=related
user1141649
CC BY-SA 3.0
2017-07-30T10:00:57.160Z
@barrycarter: I have added results of my test and updated the question.
user1141649
CC BY-SA 3.0
2017-07-30T15:40:26.960Z
@barrycarter: I have added fmod(varibale, 24) if this is want you want. I see the negative number is about -7 and the positive number is about 17. Is this what is expected? Ah, got it! 24-7 = 17. The negative number is in inverse order.
user1141649
<time>
Sidereal time calculation
user1141649
# Sidereal time calculation

(Asked by: username_0 on 2017-07-29)

I am creating program in C which is derived from Javascript Solar Radiation calculator based on a book Guide to HTML, JavaScript and PHP: For Scientists and Engineers By David R. Brooks. The original program calculates Sidereal time like this:
  // Sidereal time (Theta0)
  double GMST = 280.46061837+360.98564736629*( i->JulianDate-2451545.);
  // Sidereal_time = GMST + 0.000387933*T2 - T3/38710000
  double Sidereal_time = GMST+0.000387933*T*T
       -T*T*T/38710000.;
  // Performance optimalizatuion of code for Sidereal=fmod(Sidereal,360.) or Sidereal%360
  double S_save=Sidereal_time/360.;
  if (S_save < 0.) Sidereal_time = Sidereal_time-ceil(S_save)*360.;
  else Sidereal_time = Sidereal_time-floor(S_save)*360.;
  if (Sidereal_time < 0.) Sidereal_time+=360.;

Where i->JulianDate is date/time specified by user which is converted to Julian date. As you can see this approach is based on 2451545.0 which is the equivalent of January 1, 2000, at 12:00:00 UT and 36525.0 is Julian Year. I am not sure why there is 36525 instead 365.25 (days of Julian Year). Can you explain this?
Once more the same code without comments:
  double GMST = 280.46061837+360.98564736629*( i->JulianDate-2451545.);
  double Sidereal_time = GMST+0.000387933*T*T-T*T*T/38710000.;
  double S_save=Sidereal_time/360.;
  if (S_save < 0.) 
     Sidereal_time = Sidereal_time-ceil(S_save)*360.;
  else 
     Sidereal_time = Sidereal_time-floor(S_save)*360.;
  if (Sidereal_time < 0.) 
     Sidereal_time+=360.;

Another question:
If I enter date older than January 1, 2000, at 12:00:00 UT, e.g. 1945, will the sidereal time be correct? Or do I need to change the number 36525.0 to extend the range?
Yet, before the Sidereal time is calculated in the program there is this:
double T=( i->JulianDate-2451545.0)/36525.0; Which is similar thing.
Sidereal_time is used to calculate hour_angle which is used to calculate Sun's elevation and Solar Zenit Angle Z. Will this variables be affected when I type 1945 or older date in the program?
EDIT:
I have added log to my program which printed values into file. I have tested the program for range 1990-2010. You can see that the SideReal time same as L0 (Geometric mean longitude) is negative number when the date is older than 2000/01/01 as defined in the program to calculate T. The difference of 10 years is cca 0.09999 of Julian century. 
Date:1990 1 1 12:0:0
Julian Century: -0.099986
L0 - geometric mean longitude of the sun:: -3319.117706
GMST: -1318039.123563
Sidereal time: -1318039.123559
Julian Date: 2447893.000000

Date:1991 1 1 12:0:0
Julian Century: -0.089993
L0 - geometric mean longitude of the sun:: -2959.356420
GMST: -1186279.362275
Sidereal time: -1186279.362271
Julian Date: 2448258.000000

Date:1992 1 1 12:0:0
Julian Century: -0.080000
L0 - geometric mean longitude of the sun:: -2599.595134
GMST: -1054519.600986
Sidereal time: -1054519.600983
Julian Date: 2448623.000000

Date:1993 1 1 12:0:0
Julian Century: -0.069979
L0 - geometric mean longitude of the sun:: -2238.848201
GMST: -922398.854050
Sidereal time: -922398.854048
Julian Date: 2448989.000000

Date:1994 1 1 12:0:0
Julian Century: -0.059986
L0 - geometric mean longitude of the sun:: -1879.086915
GMST: -790639.092761
Sidereal time: -790639.092760
Julian Date: 2449354.000000

Date:1995 1 1 12:0:0
Julian Century: -0.049993
L0 - geometric mean longitude of the sun:: -1519.325629
GMST: -658879.331472
Sidereal time: -658879.331472
Julian Date: 2449719.000000

Date:1996 1 1 12:0:0
Julian Century: -0.040000
L0 - geometric mean longitude of the sun:: -1159.564343
GMST: -527119.570184
Sidereal time: -527119.570183
Julian Date: 2450084.000000

Date:1997 1 1 12:0:0
Julian Century: -0.029979
L0 - geometric mean longitude of the sun:: -798.817409
GMST: -394998.823248
Sidereal time: -394998.823247
Julian Date: 2450450.000000

Date:1998 1 1 12:0:0
Julian Century: -0.019986
L0 - geometric mean longitude of the sun:: -439.056123
GMST: -263239.061959
Sidereal time: -263239.061959
Julian Date: 2450815.000000

Date:1999 1 1 12:0:0
Julian Century: -0.009993
L0 - geometric mean longitude of the sun:: -79.294836
GMST: -131479.300670
Sidereal time: -131479.300670
Julian Date: 2451180.000000

Date:2000 1 1 12:0:0
Julian Century: 0.000000
L0 - geometric mean longitude of the sun:: 280.466450
GMST: 280.460618
Sidereal time: 280.460618
Julian Date: 2451545.000000

Date:2001 1 1 12:0:0
Julian Century: 0.010021
L0 - geometric mean longitude of the sun:: 641.213384
GMST: 132401.207554
Sidereal time: 132401.207554
Julian Date: 2451911.000000

Date:2002 1 1 12:0:0
Julian Century: 0.020014
L0 - geometric mean longitude of the sun:: 1000.974670
GMST: 264160.968843
Sidereal time: 264160.968843
Julian Date: 2452276.000000

Date:2003 1 1 12:0:0
Julian Century: 0.030007
L0 - geometric mean longitude of the sun:: 1360.735957
GMST: 395920.730132
Sidereal time: 395920.730132
Julian Date: 2452641.000000

Date:2004 1 1 12:0:0
Julian Century: 0.040000
L0 - geometric mean longitude of the sun:: 1720.497244
GMST: 527680.491421
Sidereal time: 527680.491421
Julian Date: 2453006.000000

Date:2005 1 1 12:0:0
Julian Century: 0.050021
L0 - geometric mean longitude of the sun:: 2081.244178
GMST: 659801.238357
Sidereal time: 659801.238358
Julian Date: 2453372.000000

Date:2006 1 1 12:0:0
Julian Century: 0.060014
L0 - geometric mean longitude of the sun:: 2441.005465
GMST: 791560.999645
Sidereal time: 791560.999647
Julian Date: 2453737.000000

Date:2007 1 1 12:0:0
Julian Century: 0.070007
L0 - geometric mean longitude of the sun:: 2800.766751
GMST: 923320.760934
Sidereal time: 923320.760936
Julian Date: 2454102.000000

Date:2008 1 1 12:0:0
Julian Century: 0.080000
L0 - geometric mean longitude of the sun:: 3160.528038
GMST: 1055080.522223
Sidereal time: 1055080.522225
Julian Date: 2454467.000000

Date:2009 1 1 12:0:0
Julian Century: 0.090021
L0 - geometric mean longitude of the sun:: 3521.274973
GMST: 1187201.269159
Sidereal time: 1187201.269162
Julian Date: 2454833.000000

Date:2010 1 1 12:0:0
Julian Century: 0.100014
L0 - geometric mean longitude of the sun:: 3881.036260
GMST: 1318961.030447
Sidereal time: 1318961.030451
Julian Date: 2455198.000000

EDIT2: fmod(GMST,24); fmod(Sidereal_time,24);
Date:1990 1 1 12:0:0
Julian Century: -0.099986
L0 - geometric mean longitude of the sun:: -3319.117706
GMST: -7.123563
Sidereal time: -7.123559
Julian Date: 2447893.000000

Date:1991 1 1 12:0:0
Julian Century: -0.089993
L0 - geometric mean longitude of the sun:: -2959.356420
GMST: -7.362275
Sidereal time: -7.362271
Julian Date: 2448258.000000

Date:1992 1 1 12:0:0
Julian Century: -0.080000
L0 - geometric mean longitude of the sun:: -2599.595134
GMST: -7.600986
Sidereal time: -7.600983
Julian Date: 2448623.000000

Date:1993 1 1 12:0:0
Julian Century: -0.069979
L0 - geometric mean longitude of the sun:: -2238.848201
GMST: -6.854050
Sidereal time: -6.854048
Julian Date: 2448989.000000

Date:1994 1 1 12:0:0
Julian Century: -0.059986
L0 - geometric mean longitude of the sun:: -1879.086915
GMST: -7.092761
Sidereal time: -7.092760
Julian Date: 2449354.000000

Date:1995 1 1 12:0:0
Julian Century: -0.049993
L0 - geometric mean longitude of the sun:: -1519.325629
GMST: -7.331472
Sidereal time: -7.331472
Julian Date: 2449719.000000

Date:1996 1 1 12:0:0
Julian Century: -0.040000
L0 - geometric mean longitude of the sun:: -1159.564343
GMST: -7.570184
Sidereal time: -7.570183
Julian Date: 2450084.000000

Date:1997 1 1 12:0:0
Julian Century: -0.029979
L0 - geometric mean longitude of the sun:: -798.817409
GMST: -6.823248
Sidereal time: -6.823247
Julian Date: 2450450.000000

Date:1998 1 1 12:0:0
Julian Century: -0.019986
L0 - geometric mean longitude of the sun:: -439.056123
GMST: -7.061959
Sidereal time: -7.061959
Julian Date: 2450815.000000

Date:1999 1 1 12:0:0
Julian Century: -0.009993
L0 - geometric mean longitude of the sun:: -79.294836
GMST: -7.300670
Sidereal time: -7.300670
Julian Date: 2451180.000000

Date:2000 1 1 12:0:0
Julian Century: 0.000000
L0 - geometric mean longitude of the sun:: 280.466450
GMST: 16.460618
Sidereal time: 16.460618
Julian Date: 2451545.000000

Date:2001 1 1 12:0:0
Julian Century: 0.010021
L0 - geometric mean longitude of the sun:: 641.213384
GMST: 17.207554
Sidereal time: 17.207554
Julian Date: 2451911.000000

Date:2002 1 1 12:0:0
Julian Century: 0.020014
L0 - geometric mean longitude of the sun:: 1000.974670
GMST: 16.968843
Sidereal time: 16.968843
Julian Date: 2452276.000000

Date:2003 1 1 12:0:0
Julian Century: 0.030007
L0 - geometric mean longitude of the sun:: 1360.735957
GMST: 16.730132
Sidereal time: 16.730132
Julian Date: 2452641.000000

Date:2004 1 1 12:0:0
Julian Century: 0.040000
L0 - geometric mean longitude of the sun:: 1720.497244
GMST: 16.491421
Sidereal time: 16.491421
Julian Date: 2453006.000000

Date:2005 1 1 12:0:0
Julian Century: 0.050021
L0 - geometric mean longitude of the sun:: 2081.244178
GMST: 17.238357
Sidereal time: 17.238358
Julian Date: 2453372.000000

Date:2006 1 1 12:0:0
Julian Century: 0.060014
L0 - geometric mean longitude of the sun:: 2441.005465
GMST: 16.999645
Sidereal time: 16.999647
Julian Date: 2453737.000000

Date:2007 1 1 12:0:0
Julian Century: 0.070007
L0 - geometric mean longitude of the sun:: 2800.766751
GMST: 16.760934
Sidereal time: 16.760936
Julian Date: 2454102.000000

Date:2008 1 1 12:0:0
Julian Century: 0.080000
L0 - geometric mean longitude of the sun:: 3160.528038
GMST: 16.522223
Sidereal time: 16.522225
Julian Date: 2454467.000000

Date:2009 1 1 12:0:0
Julian Century: 0.090021
L0 - geometric mean longitude of the sun:: 3521.274973
GMST: 17.269159
Sidereal time: 17.269162
Julian Date: 2454833.000000

Date:2010 1 1 12:0:0
Julian Century: 0.100014
L0 - geometric mean longitude of the sun:: 3881.036260
GMST: 17.030447
Sidereal time: 17.030451
Julian Date: 2455198.000000

**Tags:** time
> **Comments:**
> **username_1**: It's "sidereal", not "sitereal" btw.  
> **username_2**: The number 35625. does not appear in your code. It is unclear what you are refering to.  
> **username_0**: Some clever explanation of SideReal time https://www.youtube.com/watch?v=alnfOIWdp7E or this one https://www.youtube.com/watch?v=82p-DYgGFjI&feature=related  
> **username_0**: @barrycarter: I have added results of my test and updated the question.  
> **username_0**: @barrycarter: I have added fmod(varibale, 24) if this is want you want. I see the negative number is about -7 and the positive number is about 17. Is this what is expected? Ah, got it! 24-7 = 17. The negative number is in inverse order.  

---

## 1 answers

### Answer by username_3 on 2017-07-29. Score: 1

I have often seen programs use a Julian century, so the 36625 is probably the number of sidereal days in a century, whereas 36525 is the number of calendar days in a century (<https://en.wikipedia.org/wiki/Julian_year_(astronomy)>)

Sidereal time generally runs uniformly forward or backward :-). I think the calculation will work prior to 2000. I am not going to type it in to test it, but since you have (or will), you can test it. The sidereal time should be close to the same value for the same time and day regardless of the year.

> **Comments:**
> **username_0**: U R right. It is J. century not year. Here I made a test: [url]http://www.saecanet.com/calculation_page/000334_000463_horizontal%20coordinate_system.php[/url] 18.4306 East, 1911/12/22 - result: Julian Century=-0.88028747433265. My program result T = Julian Century = -0.880329  
> **username_0**: I have added the results of my test and updated the question.  
> **username_3**: Actually, the code calculates the sidereal time in degrees. Unless you converted it to hours, you should "mod" it with 360. Then you need to determine how "mod" works with negative numbers, but you probably just need to add 360 if the number is negative to put it in the proper range of 0 to 360.  

---

