SystemTimeWithGregorianCalendar Struct
Definition
Namespace: DataStandardizer.Chronology
A decorator that adds Gregorian calendar date and time components to any ISystemTime. It derives the year, month, day, hour, minute, and second from the wrapped value’s Julian Day Number.
public readonly struct SystemTimeWithGregorianCalendar : ISystemTimeWithDateTime
Remarks
Construct it from any ISystemTime implementation, such as a UnixTime or DosDateTime. The constructor throws ArgumentNullException when the supplied system time is null. The SystemTimeExtensions AsUnixTime() and AsDosDateTime() methods recover the original wrapped value when it was one of those types.
Constructors
| Constructor | Notes |
|---|---|
SystemTimeWithGregorianCalendar(ISystemTime systemTime) | Wraps an ISystemTime. Throws ArgumentNullException if systemTime is null. |
Properties
| Property | Signature | Notes |
|---|---|---|
Day | int Day { get; } | The day of the month. |
Hour | int Hour { get; } | The hour component. |
JulianDayNumber | decimal JulianDayNumber { get; } | The wrapped value’s Julian Day Number. |
Minute | int Minute { get; } | The minute component. |
Month | int Month { get; } | The month of the year. |
Second | int Second { get; } | The second component. |
Year | int Year { get; } | The year component. |
Extension methods
The following extensions apply to SystemTimeWithGregorianCalendar:
AsUnixTime()— returnsUnixTime?(non-null only if the wrapped value was aUnixTime).AsDosDateTime()— returnsDosDateTime?(non-null only if the wrapped value was aDosDateTime).
Applies to
Targets netstandard1.0, netstandard2.0, net8.0, and net10.0.