DateTime.Parse

Syntax

Parse(Value: String): DateTime;

Parameters

Value. The string that must be converted into the DateTime type.

Description

The Parse method converts a string into the DateTime type without validation.

Comments

This method does not take into account specified regional parameters. The value passed by the Value parameter must be specified in the following format:

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:

Example

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:

DateTime