apoc.temporal.format
Function APOC Core
apoc.temporal.format(input, format) | Format a temporal value
Usage Examples
The following formats the current date:
RETURN apoc.temporal.format( date(), 'YYYY-MM-dd') AS output;
output |
---|
"2021-01-19" |
The following formats the current datetime:
RETURN apoc.temporal.format( datetime(), 'YYYY-MM-dd HH:mm:ss.SSSSZ') AS output;
output |
---|
"2021-01-19 10:57:25.2140+0000" |
The following formats the current time:
RETURN apoc.temporal.format( localtime(), 'HH:mm:ss.SSSS') AS output;
output |
---|
"10:57:57.8140" |
The following formats a date:
RETURN apoc.temporal.format( date( { year: 2018, month: 12, day: 10 } ), 'ISO_DATE' ) as output;
Output |
---|
"2018-12-10" |
The following formats a duration:
RETURN apoc.temporal.format( duration.between( datetime.transaction(), datetime.realtime() ) , 'HH:mm:ss.SSSS') AS output;
Output |
---|
"00:00:00.0131" |