Passed a String returns a date with the indicated format.
1 date.parse
<date.parse
format='format'
lang='lang'
timezone='timezone'
>
<date /> *
</date.parse>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aformat | String | user_format | Date format, for example dd-MM-yyyy HH:mm:ss z. If it is not indicated format the user's format is used. | ||
Alang | String | user_lang | Language to form the Locale to the parser function. If the format is not indicated, the user's format is used. The language is necessary when the used month's format is alphanumeric (MMM) for example "ene". | ||
Atimezone | String | Time zone, for example America/Mexico_City. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Edate | Date | Date which you should parsear. |
Returns | |
---|---|
Type | Description |
Date | The date with the specified format and time zone. |
Example
Pass a string to a date format.
Copy
<xsql-script name='date_parse_sample1'> <body> <set name='var'> <date.parse format='MM-dd-yyyy'>05-01-2100</date.parse> </set> <println><var /></println> </body> </xsql-script>
Returns:
Copy
01-05-2100
Notas
If a String which does not respect the format is passed, the transformation is not done.