asp.net.ph

Convert.ToDateTime Method ( String, IFormatProvider )

System Namespace   Convert Class


Converts the specified String representation of a number to an equivalent DateTime using the specified culture-specific formatting information.

[ VB ]
Overloads Public Shared Function ToDateTime ( _
   ByVal value As String, _
   ByVal provider As IFormatProvider _
) As DateTime

[ C# ]
public static DateTime ToDateTime ( 
   string value,
   IFormatProvider provider
);

[ C++ ]
public: static DateTime ToDateTime ( 
   String* value,
   IFormatProvider* provider
);

[ JScript ]
public static function ToDateTime (
   value : String,
   provider : IFormatProvider
) : DateTime;

Parameters

value
A String containing a number to convert.
provider
An IFormatProvider interface implementation that supplies culture-specific formatting information.

Return Value

A DateTime equivalent of value.

Exceptions


Exception Type Condition
ArgumentException value is a null reference ( Nothing in Visual Basic ).
FormatException value is not a properly formatted date and time.
OverflowException value represents a number less than MinValue or greater than MaxValue.

Remarks

The return value is the result of invoking the DateTime.Parse method on value.

provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is a null reference ( Nothing in Visual Basic ), the NumberFormatInfo for the current culture is used.

See Also

Convert Members   Convert.ToDateTime Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph