Format
ParseDate(StringTime [,FormatString])
Returns
Returns the time that is the result of parsing the provided String argument.
Inputs
StringTime: The time expressed as a string.
Behaviour: Required
Dimension: Collection, SingleValue, MultiCollection
Valid data types: String
FormatString: The expected format of StringTime according to the Format Codes table below. If this is not specified, StringTime is assumed to be in ISO format. The spacing of the FormatString parameter must exactly match that of the StringTime parameter, including spaces.
Behaviour: Optional
Dimension: Collection, SingleValue
Valid data types: String
Format Codes
YYYY | Four-digit year |
YY | Two-digit year (00 to 99, from 2000) |
IY | Two-digit year (00 to 99, from 2000) |
MM | Two-digit month (01 to 12) |
DD | Two-digit day of month (01 to 31) |
HH | Two-digit hour (00 to 23) |
MI | Two-digit minute (00 to 59) |
SS | Two-digit seconds (00 to 59) |
Examples
Expression: ParseDate("2007-12-31T15:00:00+00:00")
Result: Produces the UTC seconds since 1970 of this time.
Expression: ParseDate("01 01-01-1970", "MI DD/MM/YYYY”)
Result: Returns an error because the hour is not specified in the FormatString pattern.
Expression: ParseDate("01-01-2007 00:00:01", "DD/MM/YYYY HH:MI:SS")
Result: Returns an error because the StringTime argument uses dashes to separate the year, month and day, but the FormatString pattern uses slashes.
Release History
- ParseDate() 4.6.5
- Changed StringTime parameter to support MultiCollection values.
- ParseDate() 4.0
- Initial version