Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8? Click here and leave these dusty old pages behind!
Availability
This routine is available starting with SIL Engine™ 2.5.10 / 2.6.2.
Syntax
parseDate(format, date_as_string[, locale_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. |
locale_as_string | string | No | Language tag which should be used to parse a date. It can be leveraged to parse dates like this: 5/фев/18. This parameter accepts well-formed BCP 47 language tag. See this link for more details on possible values. |
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) print("(3) Parsed date is:" + parseDate("dd/MMM/yy", "5/фев/18", "ru-RU")); // returns a valid date which is parsed using ru-RU locale
See also