Click or drag to resize
DateTimeParse Method (String, IFormatProvider)
Converts the specified string representation of a date and time to its DateTime equivalent using the specified culture-specific format information.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static DateTime Parse(
	string s,
	IFormatProvider provider
)

Parameters

s
Type: SystemString
A string containing a date and time to convert.
provider
Type: SystemIFormatProvider
An object that supplies culture-specific format information about s.

Return Value

Type: DateTime
An object that is equivalent to the date and time contained in s as specified by provider.
Exceptions
ExceptionCondition
ArgumentNullExceptions is null.
FormatExceptions does not contain a valid string representation of a date and time.
See Also