Click or drag to resize

GregorianDateTryParse Method (String, IFormatProvider, GregorianDate)

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

Note: GregorianDate is always assumed to be in UTC. You cannot parse strings containing time zone information. However, this method handles three common ISO8601 formats:

  • the extended format "YYYY-MM-DDThh:mm:ss.sZ"
  • The "day of year" equivalent "YYYY-DDDThh:mm:ss.sZ"
  • The basic format "YYYYMMDDThhmmss.sZ"

Namespace:  AGI.Foundation.Time
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 20.3.405.0 (20.3.405.0)
Syntax
public static bool TryParse(
	string s,
	IFormatProvider provider,
	out GregorianDate result
)

Parameters

s
Type: SystemString
A string containing a date and time to convert.
provider
Type: SystemIFormatProvider
An IFormatProvider that supplies culture-specific format information about s.
result
Type: AGI.Foundation.TimeGregorianDate
On return, the GregorianDate value equivalent to the date and time contained in s, if the conversion succeeded, or MinValue if the conversion failed. The conversion fails if the s parameter is , or does not contain a valid string representation of a date and time.

Return Value

Type: Boolean
if s was parsed successfully; otherwise .
See Also