util.Date.parse

Converts a string to a DATE value according to a format specification.

Syntax

util.Date.parse(
  src STRING,
  fmt STRING
 )
  RETURNING res DATE
  1. src is the source string to be parsed.
  2. fmt is the format specification (see Formatting DATE values).

Usage

The util.Date.parse() method parses a string according to a format specification, to produce a DATE value.

The format specification must be a combination of dd, mm, yyyy place holders as with the USING operator.

The method returns NULL, if the source string cannot be converted to a DATE value according to the format specification.

For more details about the supported formats, see Formatting DATE values.

Example

IMPORT util
MAIN
    DISPLAY util.Date.parse( "2014-03-15", "yyyy-mm-dd" )
END MAIN