Table of Contents

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

s string

The string to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

date DateOnly

When this method returns true, the parsed date.

time TimeOnly?

When this method returns true, the parsed time, or null if no time was specified.

Returns

bool

true if s was parsed successfully; otherwise, false.

Remarks

A limitation of this method is that when s specifies a time, a date value of January 1, 0001, will be rejected.