Parse(Value: String): DateTime;
Value. The string that must be converted into the DateTime type.
The Parse method converts a string into the DateTime type without validation.
This method does not take into account specified regional parameters. The value passed by the Value parameter must be specified in the following format:
"DD.MM.YYYY". To convert date.
"DD.MM.YYYY HH:MM:SS". To convert date and time.
"DD.MM.YYYY HH:MM:SS.000". To convert date and time with milliseconds.
The specified value must correspond to the available range, which 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. If the date that is greater than the available one, or if converting failed, an exception is thrown.
To convert date and time in accordance with the set regional parameters, use the following methods:
Sub UserProc;
Var
d: DateTime;
Begin
d := DateTime.Parse("01.01.2000 10:10:10");
Debug.WriteLine(d.ToString);
End Sub UserProc;
After executing the example the "d" variable contains date and time obtained by converting from the specified string value.
See also: