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)
Syntaxpublic static GregorianDate ParseExact(
string s,
string format,
IFormatProvider provider
)
Public Shared Function ParseExact (
s As String,
format As String,
provider As IFormatProvider
) As GregorianDate
public:
static GregorianDate ParseExact(
String^ s,
String^ format,
IFormatProvider^ provider
)
static member ParseExact :
s : string *
format : string *
provider : IFormatProvider -> GregorianDate
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.
ExceptionsException | Condition |
---|
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