TryParse(Value: String; Var Result: DateTime): Boolean;
Value. The string that should be converted to the DateTime type.
Result. The date converted from the string.
The TryParse method converts a string into the DateTime type with validation.
Available values:
True. Conversion was successful. The converted value is placed to the variable specified in theResult parameter.
False. Conversion failed.
The specified value must correspond to the available range that is set for the DateTime data type. If the date that is less than the available one is specified, the date, to which the current century is added, is automatically formed.
Sub UserProc;
Var
d: DateTime;
b: Boolean;
Begin
b := DateTime.TryParse("01.01.02", D);
End Sub UserProc;
If after executing the example the "b" variable contains True, the conversion was successful, and the "d" variable contains the date "01.01.02".
See also: