Availability
This routine is available starting with katl-commons 2.5.10 / 2.6.2.
Syntax
parseDate(format, date_as_string)
Description
Returns the parsed date according to the format you provided. If parse fails, it will return a null date.Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
format | string | Yes | Valid Java format, as defined here: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html. |
date_as_string | string | Yes | String which represents the date. |
Return type
date
Example
print("(1) Parsed date is:" + parseDate("yyyy.MM.dd", "2000.01.01")); //returns a valid date print("(2) Parsed date is:" + parseDate("yyyy.MM.dd", "2000/01/01")); //returns an empty date (null)
See also