17 double year = inputYear;
20 double b = (year / 100).Floor();
21 double c = year % 100;
22 double d = (b / 4).Floor();
24 double f = ((b + 8) / 25).Floor();
25 double g = ((b - f + 1) / 3).Floor();
26 double h = ((19 * a) + b - d - g + 15) % 30;
27 double i = (c / 4).Floor();
29 double l = (32 + 2 * (e + i) - h - k) % 7;
30 double m = ((a + (11 * h) + (22 * l)) / 451).Floor();
31 double n = ((h + l - (7 * m) + 114) / 31).Floor();
32 double p = (h + l - (7 * m) + 114) % 31;
37 return ((
int)month, (int)day, (
int)year);
48 month = year.IsLeapYear() ? month * 62 : month * 63;
49 month = (int)((
double)month / 2).Floor();
53 month = (int)(((
double)month + 1) * 30.6).Floor();
54 month = year.IsLeapYear() ? month - 62 : month - 63;
85 public (
int utHours,
int utMinutes,
int utSeconds,
int gwDay,
int gwMonth,
int gwYear)
LocalCivilTimeToUniversalTime(
double lctHours,
double lctMinutes,
double lctSeconds,
bool isDaylightSavings,
int zoneCorrection,
double localDay,
int localMonth,
int localYear)
89 int daylightSavingsOffset = isDaylightSavings ? 1 : 0;
91 double utInterim = lct - daylightSavingsOffset - zoneCorrection;
92 double gdayInterim =
localDay + (utInterim / 24);
100 double ut = 24 * (gDay - gDay.Floor());
116 public (
int lctHours,
int lctMinutes,
int lctSeconds,
int localDay,
int localMonth,
int localYear)
UniversalTimeToLocalCivilTime(
double utHours,
double utMinutes,
double utSeconds,
bool isDaylightSavings,
int zoneCorrection,
int gwDay,
int gwMonth,
int gwYear)
118 int dstValue = isDaylightSavings ? 1 : 0;
120 double zoneTime = ut + zoneCorrection;
121 double localTime = zoneTime + dstValue;
124 double integerDay =
localDay.Floor();
128 double lct = 24 * (
localDay - integerDay);
147 double s = jd - 2451545;
148 double t = s / 36525;
149 double t01 = 6.697374558 + (2400.051336 * t) + (0.000025862 * t * t);
150 double t02 = t01 - (24.0 * (t01 / 24).Floor());
152 double a = ut * 1.002737909;
153 double gst1 = t02 + a;
154 double gst2 = gst1 - (24.0 * (gst1 / 24).Floor());
170 double s = jd - 2451545;
171 double t = s / 36525;
172 double t01 = 6.697374558 + (2400.051336 * t) + (0.000025862 * t * t);
173 double t02 = t01 - (24 * (t01 / 24).Floor());
176 double a = gstHours1 - t02;
177 double b = a - (24 * (a / 24).Floor());
178 double ut = b * 0.9972695663;
195 double offset = geographicalLongitude / 15;
196 double lstHours1 = gst + offset;
197 double lstHours2 = lstHours1 - (24 * (lstHours1 / 24).Floor());
213 double longHours = geographicalLongitude / 15;
214 double gst1 = gst - longHours;
215 double gst2 = gst1 - (24 * (gst1 / 24).Floor());
Date and time calculations.
int int double PAWarningFlag warningFlag GreenwichSiderealTimeToUniversalTime(double gstHours, double gstMinutes, double gstSeconds, double gwDay, int gwMonth, int gwYear)
int int int Year GetDateOfEaster(int inputYear)
int gstHours
Convert Universal Time to Greenwich Sidereal Time.
double CivilTimeToDecimalHours(double hours, double minutes, double seconds)
Convert a Civil Time (hours,minutes,seconds) to Decimal Hours.
int int double lstSeconds GreenwichSiderealTimeToLocalSiderealTime(double gstHours, double gstMinutes, double gstSeconds, double geographicalLongitude)
int lctHours
Convert Universal Time to local Civil Time.
double double double seconds DecimalHoursToCivilTime(double decimalHours)
int utHours
Convert local Civil Time to Universal Time.
int int int int int int localYear UniversalTimeToLocalCivilTime(double utHours, double utMinutes, double utSeconds, bool isDaylightSavings, int zoneCorrection, int gwDay, int gwMonth, int gwYear)
int Month
Gets the date of Easter for the year specified.
int int double gstSeconds LocalSiderealTimeToGreenwichSiderealTime(double lstHours, double lstMinutes, double lstSeconds, double geographicalLongitude)
int int int int int gwMonth
int int int int int int gwYear LocalCivilTimeToUniversalTime(double lctHours, double lctMinutes, double lctSeconds, bool isDaylightSavings, int zoneCorrection, double localDay, int localMonth, int localYear)
int int int int int localMonth
int int double gstSeconds UniversalTimeToGreenwichSiderealTime(double utHours, double utMinutes, double utSeconds, double gwDay, int gwMonth, int gwYear)
double hours
Convert Decimal Hours to Civil Time.
int CivilDateToDayNumber(int month, int day, int year)
Calculate day number for a date.
int lstHours
Convert Greenwich Sidereal Time to Local Sidereal Time.
Miscellaneous macro functions supporting the other classes.
static double CivilDateToJulianDate(double day, double month, double year)
Convert a Greenwich Date/Civil Date (day,month,year) to Julian Date.
static double JulianDateDay(double julianDate)
Returns the day part of a Julian Date.
static int DecimalHoursMinute(double decimalHours)
Return the minutes part of a Decimal Hours.
static double DecimalHoursSecond(double decimalHours)
Return the seconds part of a Decimal Hours.
static int JulianDateMonth(double julianDate)
Returns the month part of a Julian Date.
static int DecimalHoursHour(double decimalHours)
Return the hour part of a Decimal Hours.
static int JulianDateYear(double julianDate)
Returns the year part of a Julian Date.
static double HMStoDH(double hours, double minutes, double seconds)
Convert a Civil Time (hours,minutes,seconds) to Decimal Hours.
PAWarningFlag
Warning flags for calculation results.