Click or drag to resize

GregorianDate.ParseExact Method (String, String, IFormatProvider)

Converts the specified string representation of a date and time to its GregorianDate equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

Note that GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information.

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 25.1.421.0 (25.1.421.0)
Syntax
public static GregorianDate ParseExact(
	string s,
	string format,
	IFormatProvider provider
)

Parameters

s
Type: System.String
A string containing a date and time to convert.
format
Type: System.String
The expected format of s.
provider
Type: System.IFormatProvider
An IFormatProvider that supplies culture-specific format information about s.

Return Value

Type: GregorianDate
A GregorianDate equivalent to the date and time contained in s as specified by format and provider.
Exceptions
ExceptionCondition
ArgumentNullException Thrown when s or format is null.
FormatException Thrown when s or format is an empty string, or when s does not contain a date and time that corresponds to the pattern specified in format.
See Also