Click or drag to resize

JulianDate Structure

An astronomical Julian Date, which is the number of days since noon on January 1, -4712 (4713 BC). For increased precision, this class stores the whole number part of the date as an Int32 and the seconds into the day as a Double.

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public struct JulianDate : IComparable<JulianDate>, 
	IComparable, IEquatable<JulianDate>, IEquatableEpsilon<JulianDate>, 
	IConvertible

The JulianDate type exposes the following members.

Constructors
  NameDescription
Public methodJulianDate(DateTime)
Initializes a JulianDate from a DateTime. The time standard will be Coordinated Universal Time (UTC).
Public methodJulianDate(Double)
Initializes a JulianDate from a double expressing the complete astronomical Julian Date. The time standard will be International Atomic Time (TAI).
Public methodJulianDate(GregorianDate)
Initializes a JulianDate from a GregorianDate. The time standard will be CoordinatedUniversalTime (UTC), except when the gregorianDate represents time during a leap second. During a leap second, the JulianDate will be in the InternationalAtomicTime (TAI) standard.
Public methodJulianDate(DateTime, TimeStandard)
Initializes a JulianDate from a DateTime and specified time standard.
Public methodJulianDate(Double, TimeStandard)
Initializes a JulianDate from a double expressing the complete astronomical Julian Date.
Public methodJulianDate(GregorianDate, TimeStandard)
Initializes a JulianDate from a GregorianDate where the GregorianDate is expressed in the given TimeStandard. If the date is during a leap second, the JulianDate will be expressed in InternationalAtomicTime (TAI).
Public methodJulianDate(Int32, Double)
Initializes a JulianDate from the provided values. The values will be normalized so that the SecondsOfDay property is less than the length of a day. The time standard will be International Atomic Time (TAI).
Public methodJulianDate(Int32, Double, TimeStandard)
Initializes a JulianDate from the provided values. The values will be normalized so that the SecondsOfDay property is less than the length of the day.
Top
Properties
  NameDescription
Public propertyDay
Gets the integer portion of the Julian Date (or astronomical Julian day number).
Public propertyStatic memberMaxValue
Gets the largest possible value of JulianDate. This date is in InternationalAtomicTime and may not be representable in other time formats.
Public propertyStatic memberMinValue
Gets the smallest value possible of JulianDate. This date is in InternationalAtomicTime and may not be representable in other time formats.
Public propertyStatic memberNow
Gets the JulianDate that represents the current date and time. The time standard will be Coordinated Universal Time (UTC).
Public propertySecondsOfDay
Gets the number of seconds past noon on the whole-number Julian Day.
Public propertyStandard
Gets the TimeStandard that this astronomical Julian date is based upon.
Public propertyTotalDays
Gets the total number of whole and fractional days represented by this astronomical Julian date.
Top
Methods
  NameDescription
Public methodAdd
Adds a Duration to this Julian date, producing a new Julian date.
Public methodAddClamped
Adds a Duration to this Julian date, producing a new Julian date. Unlike Add(Duration), this method will clamp the result to the valid range of values for JulianDate rather than throwing an exception. In most cases, Add(Duration) should be used instead.
Public methodAddDays
Adds the specified number of days to this date and returns the new date.
Public methodAddHours
Adds the specified number of hours to this date and returns the new date.
Public methodAddMinutes
Adds the specified number of minutes to this date and returns the new date.
Public methodAddSeconds
Adds the specified number of seconds to this date and returns the new date.
Public methodCompareTo(JulianDate)
Compares this instance with another instance of the same type.
Public methodCompareTo(Object)
Compares this instance with another instance of the same type.
Public methodDaysDifference
Computes the number of days that have elapsed from this Julian date to the other Julian date.
Public methodEquals(JulianDate)
Returns true if this date exactly equals another date. To be considered equal, the Day and SecondsOfDay properties must be identical when converted to a common time standard. It is highly recommended that you use EqualsEpsilon(JulianDate, Double) or IsIdentical(JulianDate) instead of this method.
Public methodEquals(Object)
Returns true if this date exactly equals another date. To be considered equal, the Day and SecondsOfDay properties must be identical when converted to a common time standard. It is highly recommended that you use EqualsEpsilon(JulianDate, Double) or IsIdentical(JulianDate) instead of this method.
(Overrides ValueTypeEquals(Object).)
Public methodEqualsEpsilon
Returns true if this date is within epsilon seconds of the specified date. That is, in order for the dates to be considered equal (and for this function to return true), the absolute value of the difference between them, in seconds, must be less than or equal to epsilon.
Public methodStatic memberGetCenterOfWindow
Divides time into windows, each of length windowLength seconds, with the first window centered on referenceEpoch. Then, identifies which window contains date and returns the date that is at the center of that window. This is helpful for computing a discrete value for a range of Julian dates.
Public methodGetHashCode
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsIdentical
Returns true if this date is identical to another date. Unlike Equals(JulianDate), this method will consider two dates with different time standards to be different even if the dates represent the same moment when expressed in the same time standard.
Public methodStatic memberJulianDateToYearFraction
Computes the fraction of the year corresponding to the given Julian date.
Public methodMinutesDifference
Computes the number of minutes that have elapsed from this Julian date to the other Julian date.
Public methodSecondsDifference
Computes the number of seconds that have elapsed from this Julian date to the other Julian date.
Public methodSubtract(Duration)
Subtracts a Duration from this Julian date, producing a new Julian date.
Public methodSubtract(JulianDate)
Subtracts another Julian date from this Julian date.
Public methodSubtractDays
Subtracts the specified number of days from this date and returns the new date.
Public methodSubtractHours
Subtracts the specified number of hours from this date and returns the new date.
Public methodSubtractMinutes
Subtracts the specified number of minutes from this date and returns the new date.
Public methodSubtractSeconds
Subtracts the specified number of seconds to this date and returns the new date.
Public methodToDateTime
Converts this JulianDate to a .NET standard DateTime with a default time standard of Coordinated Universal Time.
Public methodToDateTime(TimeStandard)
Converts this JulianDate to a .NET standard DateTime expressed in the specified time standard.
Public methodToGregorianDate
Converts this JulianDate to a GregorianDate with a default time standard of Coordinated Universal Time.
Public methodToGregorianDate(TimeStandard)
Converts this JulianDate to a GregorianDate expressed in the specified time standard.
Public methodToString
Returns the value of this JulianDate in the standard format.
(Overrides ValueTypeToString.)
Public methodToTimeStandard
Converts this JulianDate to the specified time standard.
Public methodTryConvertTimeStandard
Try to convert this JulianDate to the specified TimeStandard, if the specified TimeStandard is capable of representing this time.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds a Duration to a JulianDate, producing a new Julian date.
Public operatorStatic memberEquality
Returns true if the two dates are exactly equal. To be considered equal, the Day and SecondsOfDay properties must be identical when converted to a common time standard. It is highly recommended that you use EqualsEpsilon(JulianDate, Double) or IsIdentical(JulianDate) instead of this method.
Public operatorStatic memberGreaterThan
Returns true if left occurs after right.
Public operatorStatic memberGreaterThanOrEqual
Returns true if left occurs after or at the same time as right.
Public operatorStatic memberInequality
Returns true if the two dates are NOT exactly equal. To be considered equal, the Day and SecondsOfDay properties must be identical when converted to a common time standard. It is highly recommended that you use EqualsEpsilon(JulianDate, Double) or IsIdentical(JulianDate) instead of this method.
Public operatorStatic memberLessThan
Returns true if left occurs before right.
Public operatorStatic memberLessThanOrEqual
Returns true if left occurs before or at the same time as right.
Public operatorStatic memberSubtraction(JulianDate, Duration)
Subtracts a Duration from a Julian date, yielding a new JulianDate.
Public operatorStatic memberSubtraction(JulianDate, JulianDate)
Subtracts a Julian date from another Julian date, yielding a Duration.
Top
Remarks
This type assumes that days always have SecondsPerDay (86400.0) seconds. When using a JulianDate with the CoordinatedUniversalTime (UTC) time standard, a day with a leap second actually has 86401.0 seconds. The end result is that JulianDate cannot represent the moment of a leap second with the UTC time standard. It CAN represent the moment of a leap second in InternationalAtomicTime (TAI), however. Also, subtracting two UTC dates that are on opposite sides of a leap second will correctly take the leap second into account.
See Also