Class DateTimeUtilities
- Namespace
- Acuit.Pinpoint.Common
- Assembly
- Acuit.Pinpoint.Common.dll
Utility methods for working with date/times.
public static class DateTimeUtilities
- Inheritance
-
DateTimeUtilities
- Inherited Members
Methods
TryParseDateAndOptionalTime(string?, IFormatProvider?, out DateOnly, out TimeOnly?)
Parses a date/time string that must contain a date and may optionally contain a time, using the current culture.
public static bool TryParseDateAndOptionalTime(string? s, IFormatProvider? provider, out DateOnly date, out TimeOnly? time)
Parameters
sstringThe string to parse.
providerIFormatProviderAn object that provides culture-specific formatting information about
s.dateDateOnlyWhen this method returns true, the parsed date.
timeTimeOnly?When this method returns true, the parsed time, or null if no time was specified.
Returns
Remarks
A limitation of this method is that when s specifies a time, a date value of January 1, 0001, will be rejected.