convertToDate

Use the convertToDate function to change a Text date value to a DateTime value. The convertToDate function supports ISO 8601 and local formats, or you can define a custom date format to convert the Text date value to.

Function format

convertToDate(Text date value, Text date format)

  • date value: the value which is converted to a DateTime value.
  • date format (optional): the customized date format to convert the Text date value to. The DateTime Text must match the DateTime format Text. See Custom date format options.

If you do not define a custom DateTime format, the function first attempts to parse the Text date value in the ISO 8601 format. If the ISO 8601 format is not applicable, the function attempts to parse the DateTime Text in the local formats. See Localized formats.

convertToDate example

convertToDate("17/8/2018 1:30:12 am", "DD/M/YYYY, h:mm:ss a")

The formula returns the DateTime value 17/8/2018 1:30:12.