ParseDate

The ParseDate function parses a date string according to a formatter defined with the NewDateFormatter function.

A date value that is either serial or UNIX, depending on the formatter specified, is returned. If the date cannot be parsed then an undefined value is returned. This can be tested with the ISUND function.

This is a TM1® TurboIntegrator function, valid only in TurboIntegrator processes.

Syntax

ParseDate (DateString, <Pattern>, <Index>)

Arguments

Argument

Description

DateString

A date string.

Pattern

Pattern used for parsing dates.

Refer to http://userguide.icu-project.org/formatparse/datetime for a complete list of format syntax.

If an empty string is passed, then the format is determined by the locale based on the FormatterStyle and FormatterType parameters that were used with the NewDateFormatter function.

Index

Index returned by a call to the NewDateFormatter function. The default value is 0. If no date formatter exists at the index, then a default formatter is used as though it had been created with the following call:

NewDateFormatter('', 'Etc/UTC', 'serial', 'medium', 'date')

Example

nDate = ParseDate('2011/11/24', 'yyyy/MM/dd');