TimeOnlyExtensions Class
Definition
Namespace: DataStandardizer.Chronology
Extension methods that convert a TimeOnly to the system-time types UnixTime and DosDateTime.
public static class TimeOnlyExtensions
Remarks
This class and its members require .NET 6 or later (they depend on TimeOnly) and are not available on the .NET Standard targets. The whole class is gated behind #if NET6_0_OR_GREATER. ToUnixTime returns the seconds since midnight; ToDosDateTime combines the time with a fixed DOS date of 1 January 1980.
Methods
Extension
| Method | Extends | Returns | Notes |
|---|---|---|---|
ToDosDateTime() | TimeOnly | DosDateTime | (net6.0+) Combined with a fixed DOS date of 1 January 1980. |
ToUnixTime() | TimeOnly | UnixTime | (net6.0+) Seconds since midnight. |
Applies to
Available only on net8.0 and net10.0. Not available on netstandard1.0 or netstandard2.0 (requires TimeOnly, net6.0+).