apoc.temporal.format函数在 Cypher 25 中已弃用
|
此函数已弃用。请改用 Cypher 的 |
语法 |
|
||
描述 |
将给定的时间值格式化为指定的时间格式。 |
||
参数 |
名称 |
类型 |
描述 |
|
|
需要格式化的时间值。 |
|
|
|
返回时间值时所使用的格式。默认值为: |
|
返回 |
|
||
使用示例
apoc.temporal.format
RETURN apoc.temporal.format( date(), 'yyyy-MM-dd') AS output;
Cypher 的 format 函数
RETURN format(date(), 'yyyy-MM-dd') AS output;
| 输出 |
|---|
"2021-01-19" |
apoc.temporal.format
RETURN apoc.temporal.format( datetime(), 'yyyy-MM-dd HH:mm:ss.SSSSZ') AS output;
Cypher 的 format 函数
RETURN format( datetime(), 'yyyy-MM-dd HH:mm:ss.SSSSZ') AS output;
| 输出 |
|---|
"2021-01-19 10:57:25.2140+0000" |
apoc.temporal.format
RETURN apoc.temporal.format( localtime(), 'HH:mm:ss.SSSS') AS output;
Cypher 的 format 函数
RETURN format( localtime(), 'HH:mm:ss.SSSS') AS output;
| 输出 |
|---|
"10:57:57.8140" |
apoc.temporal.format
RETURN apoc.temporal.format( date( { year: 2018, month: 12, day: 10 } ), 'ISO_DATE' ) as output;
Cypher 的 format 函数
RETURN format( date( { year: 2018, month: 12, day: 10 } ) ) as output;
| 输出 |
|---|
"2018-12-10" |
apoc.temporal.format
RETURN apoc.temporal.format( duration.between( datetime.transaction(), datetime.realtime() ) , 'HH:mm:ss.SSSS') AS output;
Cypher 的 format 函数
RETURN format( duration.between( datetime.transaction(), datetime.realtime() ) , 'HH:mm:ss.SSSS') AS output;
| 输出 |
|---|
"00:00:00.0131" |