Converts the specified string representation of a date to its Date equivalent using the specified format, culture-specific format information, and formatting style. The format of the string representation must match the specified format exactly.

Namespace:  DlhSoft.Windows.Data
Assembly:  DlhSoft.ProjectData.GanttChart.LightWPF.Controls (in DlhSoft.ProjectData.GanttChart.LightWPF.Controls.dll)

Syntax

C#
public static bool TryParseExact(
	string s,
	string format,
	IFormatProvider provider,
	DateTimeStyles styles,
	out Date result
)
Visual Basic (Declaration)
Public Shared Function TryParseExact ( _
	s As String, _
	format As String, _
	provider As IFormatProvider, _
	styles As DateTimeStyles, _
	<OutAttribute> ByRef result As Date _
) As Boolean

Parameters

s
Type: System..::.String
A string containing a date to convert.
format
Type: System..::.String
The expected format of s.
provider
Type: System..::.IFormatProvider
An IFormatProvider that supplies culture-specific format information about ss.
styles
Type: System.Globalization..::.DateTimeStyles
A bitwise combination of DateTimeStyles values that indicates the permitted format of s. A typical value to specify is None.
result
Type: DlhSoft.Windows.Data..::.Date %
When this method returns, contains the Date value equivalent to the date contained in s, if the conversion succeeded, or MinValue if the conversion failed. The conversion fails if either the s or format is a null reference (Nothing in Visual Basic), s or format is an empty string, or the format of s is not exactly as specified by the format pattern in format. This parameter is passed uninitialized.

Return Value

true if the s parameter was converted successfully; otherwise, false.

See Also