apoc.date.convertFormatFunctionDeprecated in 25
Syntax |
|
||
Description |
Converts a |
||
Arguments |
Name |
Type |
Description |
|
|
A string representation of a temporal value. |
|
|
|
The format the given temporal is formatted as. |
|
|
|
The format to convert the given temporal value to. The default is: |
|
Returns |
|
||
Usage Examples
|
The The |
The following converts a date in yyyy-MM-dd format to basic_date (yyyyMMdd) format:
RETURN apoc.date.convertFormat("2020-11-04", "date", "basic_date") AS output;
RETURN format(date("2020-11-04"), "yyyyMMdd") AS output;
| output |
|---|
"20201104" |
The following converts a date in date_hour (yyyy-MM-dd’T’HH) format to date_hour_minute (yyyy-MM-dd’T’HH:mm) format:
RETURN apoc.date.convertFormat("2020-11-04T22", "date_hour", "date_hour_minute") AS output;
RETURN format(localdatetime("2020-11-04T22", "yyyy-MM-dd'T'HH"), "yyyy-MM-dd'T'HH:mm") AS output;
| output |
|---|
"2020-11-04T22:00" |