Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Excerpt
hiddentrue

 toDate(dateString) Converts a date in text into an actual date type.


Function: toDate()

Converts a standard PhixFlow date string (e.g. 20120521 or 20120521.172108) into a true date, or a non-standard date string into a true date if supplied with a format pattern.

...

Returns null if dateString is null.

Note

Beware of daylight savings clock changes! In countries where daylight savings are applied, at the point of the year when the clocks go forward, a hour will be lost. If you have a date and time that happen to fall into this missing hour, when you run a toDate() on the value, you will get an error like

Code Block
failed: Unable to convert the string "26/03/2017 01:00:15" into a date. Valid formats include dd/MM/yyyy, dd/MM/yyyy HH:mm:ss



Syntax

toDate(dateString)

toDate(dateString, formatString)

...