neo4j使用详解(六、cypher即时时间函数语法——最全参考)

2024-04-02 05:12

本文主要是介绍neo4j使用详解(六、cypher即时时间函数语法——最全参考),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

请添加图片描述


Neo4j系列导航:
neo4j及简单实践
cypher语法基础
cypher插入语法
cypher插入语法
cypher查询语法
cypher通用语法
cypher函数语法


6.时间函数-即时类型

表示具体的时刻的时间类型函数

6.1.date函数

年-月-日时间函数: yyyy-mm-dd

6.1.1.获取date

  • date(): 获取当前时间,如果未指定时区参数,则将使用本地时区 date([{timezone}])

    return date() as currentDate // 返回值2024-04-01
    return date({timezone: 'America/Los Angeles'}) // 返回值2024-04-01

  • date.transaction(): 使用transaction时返回当前date。对于同一事务中的每次调用,该值都是相同的 date.transaction([{timezone}])

    return date.transaction() as currentDate // 返回值2024-04-01

  • date.statement(): 使用statement返回当前date值。对于同一语句中的每次调用,该值都相同。但是,同一事务中的不同语句可能会产生不同的值 date.statement([{timezone}])

    return date.statement() as currentDate // 返回值2024-04-01

  • date.realtime(): 使用date返回当前值realtime。该值将是系统的实时时钟。 (系统时间)date.realtime([{timezone}])

    return date.realtime() as currentDate // 返回值2024-04-01

6.1.2.创建date

  • 创建 年-月-日: 返回一个date值,其中包含指定的年、月、日 date({year [, month, day]})

    unwind [date({year: 1984, month: 10, day: 11}),date({year: 1984, month: 10}),date({year: 1984})] as theDate return theDate // 返回值1984-10-11, 1984-10-01, 1984-01-01

  • 创建 年-周-日: date({year [, week, dayOfWeek]})

    unwind [date({year: 1984, week: 10, dayOfWeek: 3}), date({year: 1984, week: 10}),date({year: 1984})] as theDate return theDate // 返回值1984-03-07, 1984-03-05, 1984-01-01

  • 创建 年-季度-日: date({year [, quarter, dayOfQuarter]})

    unwind [date({year: 1984, quarter: 3, dayOfQuarter:45}),date({year: 1984, quarter: 3}),date({year: 1984})] as theDate return theDate // 返回值1984-08-14, 1984-07-01, 1984-01-01

  • 创建 年-日: date({year [, ordinalDay]})

    unwind [date({year: 1984, ordinalDay: 202}),date({year: 1984})] AS theDate return theDate // 返回值1984-07-20, 1984-01-01

  • 创建 根据时间字符串: date(temporalValue)

    unwind [date('2015-07-21'),date('2015-07'),date('201507'),date('2015-W30-2'),date('2015202'),date('2015')] as theDate return theDate // 返回值2015-07-21, 2015-07-01, 2015-07-01, 2015-07-21, 2015-07-21, 2015-01-01

  • 创建 使用其他时间组件: date({date [, year, month, day, week, dayOfWeek, quarter, dayOfQuarter, ordinalDay]})

    unwind [ date({year: 1984, month: 11, day: 11}), localdatetime({year: 1984, month: 11, day: 11, hour: 12, minute: 31, second: 14}), datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'}) ] as dd return date({date: dd}) as dateOnly, date({date: dd, day: 28}) as dateDay

6.1.3.分割date

返回date通过在指定组件边界(由作为参数传递给函数的截断单元表示)处最近的先前时间点处截断指定瞬时瞬时值而获得的值。
date.truncate(unit [, temporalInstantValue [, mapOfComponents ] ])

参数含义
unit计算结果为以下string值之一的字符串表达式:'millennium', 'century', 'decade', 'year', 'weekYear', 'quarter', 'month', 'week', 'day'
temporalInstantValue以下类型之一的表达式:ZONED DATETIME, LOCAL DATETIME, DATE
mapOfComponents计算包含小于 的分量的映射的表达式unit

实例:

with datetime({year: 2017, month: 11, day: 11,hour: 12, minute: 31, second: 14, nanosecond: 645876123,timezone: '+01:00'}) as dreturndate.truncate('millennium', d) as truncMillenium,date.truncate('century', d) as truncCentury,date.truncate('decade', d) AS truncDecade,date.truncate('year', d, {day: 5}) AS truncYear,date.truncate('weekYear', d) as truncWeekYear,date.truncate('quarter', d) as truncQuarter,date.truncate('month', d) as truncMonth,date.truncate('week', d, {dayOfWeek: 2}) as truncWeek,date.truncate('day', d) as truncDay

结果:

千禧年节截断世纪截断十年截断年份截断周年截断季度截断月份截断周截断日
2000-01-012000-01-012010-01-012017-01-052017-01-022017-10-012017-11-012017-11-072017-11-11

6.2.datetime函数

年-月-日 时:分:秒:毫秒时间函数:yyyy-mm-ddThh:MM:SS:sssZ

6.2.1.获取datetime

  • datetime(): datetime([{timezone}])

    return datetime() //2024-04-01T10:02:28.192Z
    return datetime({timezone: 'America/Los Angeles'}) // 2024-04-01T03:02:28.238-07:00[America/Los_Angeles]

  • datetime.transaction(): datetime.transaction([{timezone}])

    return datetime.transaction() //2024-04-01T18:02:28.290Z
    RETURN datetime.transaction('America/Los Angeles') //2024-04-01T03:02:28.338-07:00[America/Los_Angeles]

  • datetime.statement(): datetime.statement([{timezone}])

    return datetime.statement() //2024-04-01T10:02:28.395Z

  • datetime.realtime(): datetime.realtime([{timezone}])

    return datetime.realtime() //2024-04-01T10:02:28.494444Z

6.2.2.创建datatime时间

datetime()返回一个带时区的datetime值,其中包含指定的年、月、日、时、分、秒、毫秒、微秒、纳秒和时区组件值。

  • 创建 年-月-日 时:分:秒: datetime({year [, month, day, hour, minute, second, millisecond, microsecond, nanosecond, timezone]})
    实例:

    unwind[datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, millisecond: 123, microsecond: 456, nanosecond: 789}),datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, millisecond: 645, timezone: '+01:00'}),datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: 'Europe/Stockholm'}),datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14, timezone: '+01:00'}),datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, second: 14}),datetime({year: 1984, month: 10, day: 11, hour: 12, minute: 31, timezone: 'Europe/Stockholm'}),datetime({year: 1984, month: 10, day: 11, hour: 12, timezone: '+01:00'}),datetime({year: 1984, month: 10, day: 11, timezone: 'Europe/Stockholm'})
    ] as theDate return theDate
    

    结果:

    返回值
    1984-10-11T12:31:14.123456789Z
    1984-10-11T12:31:14.645+01:00
    1984-10-11T12:31:14.645876123+01:00[Europe/Stockholm]
    1984-10-11T12:31:14+01:00
    1984-10-11T12:31:14Z
    1984-10-11T12:31+01:00[Europe/Stockholm]
    1984-10-11T12:00+01:00
    1984-10-11T00:00+01:00[Europe/Stockholm]
  • 创建 年-周-日: datetime({year [, week, dayOfWeek, hour, minute, second, millisecond, microsecond, nanosecond, timezone]})
    实例:

    unwind[datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, millisecond: 645}),datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}),datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: 'Europe/Stockholm'}),datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14, timezone: 'Europe/Stockholm'}),datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, minute: 31, second: 14}),datetime({year: 1984, week: 10, dayOfWeek: 3, hour: 12, timezone: '+01:00'}),datetime({year: 1984, week: 10, dayOfWeek: 3, timezone: 'Europe/Stockholm'})
    ] as theDate return theDate
    

    结果:

    返回值
    1984-03-07T12:31:14.645Z
    1984-03-07T12:31:14.645876+01:00
    1984-03-07T12:31:14.645876123+01:00[Europe/Stockholm]
    1984-03-07T12:31:14+01:00[Europe/Stockholm]
    1984-03-07T12:31:14Z
    1984-03-07T12:00+01:00
    1984-03-07T00:00+01:00[Europe/Stockholm]
  • 创建 年-季度-日: datetime({year [, quarter, dayOfQuarter, hour, minute, second, millisecond, microsecond, nanosecond, timezone]})
    实例:

    unwind[datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, microsecond: 645876}),datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, minute: 31, second: 14, timezone: '+01:00'}),datetime({year: 1984, quarter: 3, dayOfQuarter: 45, hour: 12, timezone: 'Europe/Stockholm'}),datetime({year: 1984, quarter: 3, dayOfQuarter: 45})
    ] as theDate return theDate
    

    结果:

    返回值
    1984-08-14T12:31:14.645876Z
    1984-08-14T12:31:14+01:00
    1984-08-14T12:00+02:00[Europe/Stockholm]
    1984-08-14T00:00Z
  • 创建 年-日: datetime({year [, ordinalDay, hour, minute, second, millisecond, microsecond, nanosecond, timezone]})
    实例:

    unwind[datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, millisecond: 645}),datetime({year: 1984, ordinalDay: 202, hour: 12, minute: 31, second: 14, timezone: '+01:00'}),datetime({year: 1984, ordinalDay: 202, timezone: 'Europe/Stockholm'}),datetime({year: 1984, ordinalDay: 202})
    ] as theDate return theDate
    

    结果:

    返回值
    1984-07-20T12:31:14.645Z
    1984-07-20T12:31:14+01:00
    1984-07-20T00:00+02:00[Europe/Stockholm]
    1984-07-20T00:00Z
  • 创建 根据时间字符串: datetime(temporalValue)
    实例:

    unwind[datetime('2015-07-21T21:40:32.142+0100'),datetime('2015-W30-2T214032.142Z'),datetime('2015T214032-0100'),datetime('20150721T21:40-01:30'),datetime('2015-W30T2140-02'),datetime('2015202T21+18:00'),datetime('2015-07-21T21:40:32.142[Europe/London]'),datetime('2015-07-21T21:40:32.142-04[America/New_York]')
    ] as theDate return theDate
    

    结果:

    返回值
    2015-07-21T21:40:32.142+01:00
    2015-07-21T21:40:32.142Z
    2015-01-01T21:40:32-01:00
    2015-07-21T21:40-01:30
    2015-07-20T21:40-02:00
    2015-07-21T21:00+18:00
    2015-07-21T21:40:32.142+01:00[Europe/London]
    2015-07-21T21:40:32.142-04:00[America/New_York]
  • 创建 使用其他时间组件:
    datetime({datetime [, year, ..., timezone]}) | datetime({date [, year, ..., timezone]}) | datetime({time [, year, ..., timezone]}) | datetime({date, time [, year, ..., timezone]})
    实例:

    with date({year: 1984, month: 10, day: 11}) as dd
    return
    datetime({date: dd, hour: 10, minute: 10, second: 10}) as dateHHMMSS,
    datetime({date: dd, hour: 10, minute: 10, second: 10, timezone:'+05:00'}) as dateHHMMSSTimezone,
    datetime({date: dd, day: 28, hour: 10, minute: 10, second: 10}) as dateDDHHMMSS,
    datetime({date: dd, day: 28, hour: 10, minute: 10, second: 10, timezone:'Pacific/Honolulu'}) as dateDDHHMMSSTimezone
    

    结果:

    dateHHMMSSdateHHMMSSTimezonedateDDHHMMSSdateDDHHMMSSTimezone
    1984-10-11T10:10:10Z1984-10-11T10:10:10+05:001984-10-28T10:10:10Z1984-10-28T10:10:10-10:00[Pacific/Honolulu]
  • 创建 根据时间戳: datetime({ epochSeconds | epochMillis })

    return datetime({epochSeconds: timestamp() / 1000, nanosecond: 23}) //2022-06-14T10:02:30.000000023Z
    return datetime({epochMillis: 424797300000}) //1983-06-18T15:15Z

6.2.3.分割datetime

返回datetime通过在指定组件边界(由作为参数传递给函数的截断单元表示)处最近的先前时间点处截断指定瞬时值而获得的值。
datetime.truncate(unit [, temporalInstantValue [, mapOfComponents ] ])

参数含义
unit求值为以下字符串之一的字符串表达式:‘millennium’、‘century’、‘decade’、‘year’、‘weekYear’、‘quarter’、‘month’、‘week’、‘day’、‘hour’、‘minute’、‘second’、‘millisecond’、‘microsecond’。
temporalInstantValue以下类型之一的表达式:ZONED DATETIME, LOCAL DATETIME, DATE
mapOfComponents求值为包含小于单位的组件的映射的表达式。在截断期间,可以使用键时区附加或覆盖时区。

实例:

withdatetime({year:2017, month:11, day:11,hour:12, minute:31, second:14, nanosecond: 645876123,timezone: '+03:00'}) AS d
returndatetime.truncate('millennium', d, {timezone: 'Europe/Stockholm'}) as truncMillenium,datetime.truncate('year', d, {day: 5}) as truncYear,datetime.truncate('month', d) as truncMonth,datetime.truncate('day', d, {millisecond: 2}) as truncDay,datetime.truncate('hour', d) as truncHour,datetime.truncate('second', d) as truncSecond

结果:

truncMilleniumtruncYeartruncMonthtruncDaytruncHourtruncSecond
2000-01-01T00:00+01:00[Europe/Stockholm]2017-01-05T00:00+03:002017-11-01T00:00+03:002017-11-11T00:00:00.002+03:002017-11-11T12:00+03:002017-11-11T12:31:14+03:00

6.3.localdatetime函数

年-月-日 时:分:秒:毫秒时间函数:yyyy-mm-ddThh:MM:SS:sss

6.3.1.获取localdatetime

  • localdatetime(): localdatetime([{timezone}])

    return localdatetime() //2024-04-01T10:02:30.447
    return localdatetime({timezone: 'America/Los Angeles'}) // 2024-04-01T03:02:30.482

  • localdatetime.transaction(): localdatetime.transaction([{timezone}])

    return localdatetime.transaction() //2024-04-01T10:02:30.532

  • localdatetime.statement(): localdatetime.statement([{timezone}])

    return localdatetime.statement() //2024-04-01T10:02:30.570

  • localdatetime.realtime(): localdatetime.realtime([{timezone}])

    return localdatetime.realtime() //2024-04-01T10:02:30.647817
    return localdatetime.realtime('America/Los Angeles') //2024-04-01T03:02:30.691099

6.3.2.创建localdatetime

  • 创建 年-月-日:
    localdatetime({year [, month, day, hour, minute, second, millisecond, microsecond, nanosecond]})

    return localdatetime({year: 1984, month: 10, day: 11,hour: 12, minute: 31, second: 14, millisecond: 123, microsecond: 456, nanosecond: 789}) as theDate
    
    返回值
    1984-10-11T12:31:14.123456789
  • 创建 年-周-日:
    localdatetime({year [, week, dayOfWeek, hour, minute, second, millisecond, microsecond, nanosecond]})

    return
    localdatetime({year: 1984, week: 10, dayOfWeek: 3,hour: 12, minute: 31, second: 14, millisecond: 645
    }) as theDate
    
    返回值
    1984-03-07T12:31:14.645
  • 创建 年-季-日:
    localdatetime({year [, quarter, dayOfQuarter, hour, minute, second, millisecond, microsecond, nanosecond]})

    return
    localdatetime({
    year: 1984, quarter: 3, dayOfQuarter: 45,
    hour: 12, minute: 31, second: 14, nanosecond: 645876123
    }) as theDate
    
    返回值
    1984-08-14T12:31:14.645876123
  • 创建 年-日:
    localdatetime({year [, ordinalDay, hour, minute, second, millisecond, microsecond, nanosecond]})

    return
    localdatetime({
    year: 1984, ordinalDay: 202,
    hour: 12, minute: 31, second: 14, microsecond: 645876
    }) as theDate
    
    返回值
    1984-07-20T12:31:14.645876
  • 创建 时间格式字符串: localdatetime(temporalValue)

    unwind [localdatetime('2015-07-21T21:40:32.142'),localdatetime('2015-W30-2T214032.142'),localdatetime('2015-202T21:40:32'),localdatetime('2015202T21')] as theDate
    return theDate
    
    返回值
    2015-07-21T21:40:32.142
    2015-07-21T21:40:32.142
    2015-07-21T21:40:32
    2015-07-21T21:00
  • 创建 使用其他时间组件:
    localdatetime({datetime [, year, ..., nanosecond]}) | localdatetime({date [, year, ..., nanosecond]}) | localdatetime({time [, year, ..., nanosecond]}) | localdatetime({date, time [, year, ..., nanosecond]})
    实例1:

    with date({year: 1984, month: 10, day: 11}) as dd
    returnlocaldatetime({date: dd, hour: 10, minute: 10, second: 10}) as dateHHMMSS,localdatetime({date: dd, day: 28, hour: 10, minute: 10, second: 10}) as dateDDHHMMSS
    
    dateHHMMSSdateDDHHMMSS
    1984-10-11T10:10:101984-10-28T10:10:10

    实例2:

    WITHdatetime({year: 1984, month: 10, day: 11,hour: 12,timezone: '+01:00'}) as dd
    returnlocaldatetime({datetime: dd}) as dateTime,localdatetime({datetime: dd, day: 28, second: 42}) as dateTimeDDSS
    
    dateTimedateTimeDDSS
    1984-10-11T12:001984-10-28T12:00:42

6.3.3.分割localdatetime

localdatetime.truncate(unit [, temporalInstantValue [, mapOfComponents ] ])
实例:

withlocaldatetime({year: 2017, month: 11, day: 11,hour: 12, minute: 31, second: 14, nanosecond: 645876123}) as d
returnlocaldatetime.truncate('millennium', d) as truncMillenium,localdatetime.truncate('year', d, {day: 2}) as truncYear,localdatetime.truncate('month', d) as truncMonth,localdatetime.truncate('day', d) as truncDay,localdatetime.truncate('hour', d, {nanosecond: 2}) as truncHour,localdatetime.truncate('second', d) as truncSecond
truncMilleniumtruncYeartruncMonthtruncDaytruncHourtruncSecond
2000-01-01T00:002017-01-02T00:002017-11-01T00:002017-11-11T00:002017-11-11T12:00:00.0000000022017-11-11T12:31:14

6.4.localtime函数

时:分:秒:毫秒时间函数:hh:MM:SS.sss

6.4.1.获取localtime

  • localtime(): localtime([{timezone}])

    return localtime() //10:02:30.447
    return localtime({timezone: 'America/Los Angeles'}) // 03:02:30.482

  • localtime.transaction(): localtime.transaction([{timezone}])

    return localtime.transaction() //10:02:30.532

  • localtime.statement(): localtime.statement([{timezone}])

    return localtime.statement() //10:02:30.570

  • localtime.realtime(): localtime.realtime([{timezone}])

    return localtime.realtime() //10:02:30.647817
    return localtime.realtime('America/Los Angeles') //03:02:30.691099

6.4.2.创建localtime

  • 创建localtime:
    localtime({hour [, minute, second, millisecond, microsecond, nanosecond]})

    unwind[localtime({hour: 12, minute: 31, second: 14, nanosecond: 789, millisecond: 123, microsecond: 456}),localtime({hour: 12, minute: 31, second: 14}),localtime({hour: 12})
    ] as theTime
    return theTime
    
    返回值
    12:31:14.123456789
    12:31:14
    12:00
  • 创建 根据Time格式字符串: localtime(temporalValue)

    unwind[localtime('21:40:32.142'),localtime('214032.142'),localtime('21:40'),localtime('21')
    ] as theTime
    return theTime
    
    返回值
    21:40:32.142
    21:40:32.142
    21:40
    21:00
  • 创建 使用其他时间组件: localtime({time [, hour, ..., nanosecond]})
    实例:

    with time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) as tt
    returnlocaltime({time: tt}) as timeOnly,localtime({time: tt, second: 42}) as timeSS
    
    timeOnlytimeSS
    12:31:14.64587612:31:42.645876

6.4.3.分割localime

localtime.truncate(unit [, temporalInstantValue [, mapOfComponents ] ])
实例:

with time({hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}) as t
returnlocaltime.truncate('day', t) as truncDay,localtime.truncate('hour', t) as truncHour,localtime.truncate('minute', t, {millisecond: 2}) as truncMinute,localtime.truncate('second', t) as truncSecond,localtime.truncate('millisecond', t) as truncMillisecond,localtime.truncate('microsecond', t) as truncMicrosecond
truncDaytruncHourtruncMinutetruncSecondtruncMillisecondtruncMicrosecond
00:00:0012:00:0012:31:00.00200000012:31:1412:31:14.64500000012:31:14.645876000

6.5.time函数

时:分:秒:毫秒时间函数:hh:MM:SS.sssZ

6.4.1.获取time

  • time(): time([{timezone}])

    return time() //10:02:30.447
    return time({timezone: 'America/Los Angeles'}) // 03:02:32.351-07:00

  • time.transaction(): localtime.transaction([{timezone}])

    return time.transaction() //10:02:30.532Z

  • time.statement(): localtime.statement([{timezone}])

    return time.statement() //10:02:30.570Z

  • time.realtime(): localtime.realtime([{timezone}])

    return time.realtime() //10:02:30.647817Z
    return time.realtime('America/Los Angeles') //03:02:32.351-07:00

6.4.2.创建time

  • 创建localtime:
    time({hour [, minute, second, millisecond, microsecond, nanosecond, timezone]})

    unwind[time({hour: 12, minute: 31, second: 14, millisecond: 123, microsecond: 456, nanosecond: 789}),time({hour: 12, minute: 31, second: 14, nanosecond: 645876123}),time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}),time({hour: 12, minute: 31, timezone: '+01:00'}),time({hour: 12, timezone: '+01:00'})
    ] as theTime
    return theTime
    
    返回值
    12:31:14.123456789Z
    12:31:14.645876123Z
    12:31:14.645876000+01:00
    12:31:00+01:00
    12:00:00+01:00
  • 创建 根据Time格式字符串: time(temporalValue)

    unwind[time('21:40:32.142+0100'),time('214032.142Z'),time('21:40:32+01:00'),time('214032-0100'),time('21:40-01:30'),time('2140-00:00'),time('2140-02'),time('22+18:00')] as theTime
    return theTime
    
    返回值
    21:40:32.142000000+01:00
    21:40:32.142000000Z
    21:40:32+01:00
    21:40:32-01:00
    21:40:00-01:30
    21:40:00Z
    21:40:00-02:00
    22:00:00+18:00
  • 创建 使用其他时间组件: time({time [, hour, ..., timezone]})
    实例:

    with localtime({hour: 12, minute: 31, second: 14, microsecond: 645876}) AS tt
    returntime({time: tt}) as timeOnly,time({time: tt, timezone: '+05:00'}) as timeTimezone,time({time: tt, second: 42}) as timeSS,time({time: tt, second: 42, timezone: '+05:00'}) as timeSSTimezone
    
    timeOnlytimeTimezonetimeSStimeSSTimezone
    12:31:14.645876Z12:31:14.645876+05:0012:31:42.645876Z12:31:42.645876+05:00

6.4.3.分割localime

time.truncate(unit [, temporalInstantValue [, mapOfComponents ] ])
实例:

with time({hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}) as t
return time.truncate('day', t) as truncDay,time.truncate('hour', t) as truncHour,time.truncate('minute', t) as truncMinute,time.truncate('second', t) as truncSecond,time.truncate('millisecond', t, {nanosecond: 2}) as truncMillisecond,time.truncate('microsecond', t) as truncMicrosecond
truncDaytruncHourtruncMinutetruncSecondtruncMillisecondtruncMicrosecond
00:00:00-01:0012:00:00-01:0012:31:00-01:0012:31:14-01:0012:31:14.645000002-01:0012:31:14.645876000-01:00

这篇关于neo4j使用详解(六、cypher即时时间函数语法——最全参考)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/869055

相关文章

使用DeepSeek API 结合VSCode提升开发效率

《使用DeepSeekAPI结合VSCode提升开发效率》:本文主要介绍DeepSeekAPI与VisualStudioCode(VSCode)结合使用,以提升软件开发效率,具有一定的参考价值... 目录引言准备工作安装必要的 VSCode 扩展配置 DeepSeek API1. 创建 API 请求文件2.

使用TomCat,service输出台出现乱码的解决

《使用TomCat,service输出台出现乱码的解决》本文介绍了解决Tomcat服务输出台中文乱码问题的两种方法,第一种方法是修改`logging.properties`文件中的`prefix`和`... 目录使用TomCat,service输出台出现乱码问题1解决方案问题2解决方案总结使用TomCat,

对postgresql日期和时间的比较

《对postgresql日期和时间的比较》文章介绍了在数据库中处理日期和时间类型时的一些注意事项,包括如何将字符串转换为日期或时间类型,以及在比较时自动转换的情况,作者建议在使用数据库时,根据具体情况... 目录PostgreSQL日期和时间比较DB里保存到时分秒,需要和年月日比较db里存储date或者ti

解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题

《解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题》文章详细描述了在使用lombok的@Data注解标注实体类时遇到编译无误但运行时报错的问题,分析... 目录问题分析问题解决方案步骤一步骤二步骤三总结问题使用lombok注解@Data标注实体类,编译时

Java中注解与元数据示例详解

《Java中注解与元数据示例详解》Java注解和元数据是编程中重要的概念,用于描述程序元素的属性和用途,:本文主要介绍Java中注解与元数据的相关资料,文中通过代码介绍的非常详细,需要的朋友可以参... 目录一、引言二、元数据的概念2.1 定义2.2 作用三、Java 注解的基础3.1 注解的定义3.2 内

Java中使用Java Mail实现邮件服务功能示例

《Java中使用JavaMail实现邮件服务功能示例》:本文主要介绍Java中使用JavaMail实现邮件服务功能的相关资料,文章还提供了一个发送邮件的示例代码,包括创建参数类、邮件类和执行结... 目录前言一、历史背景二编程、pom依赖三、API说明(一)Session (会话)(二)Message编程客

C++中使用vector存储并遍历数据的基本步骤

《C++中使用vector存储并遍历数据的基本步骤》C++标准模板库(STL)提供了多种容器类型,包括顺序容器、关联容器、无序关联容器和容器适配器,每种容器都有其特定的用途和特性,:本文主要介绍C... 目录(1)容器及简要描述‌php顺序容器‌‌关联容器‌‌无序关联容器‌(基于哈希表):‌容器适配器‌:(

JavaScript中的isTrusted属性及其应用场景详解

《JavaScript中的isTrusted属性及其应用场景详解》在现代Web开发中,JavaScript是构建交互式应用的核心语言,随着前端技术的不断发展,开发者需要处理越来越多的复杂场景,例如事件... 目录引言一、问题背景二、isTrusted 属性的来源与作用1. isTrusted 的定义2. 为

使用Python实现高效的端口扫描器

《使用Python实现高效的端口扫描器》在网络安全领域,端口扫描是一项基本而重要的技能,通过端口扫描,可以发现目标主机上开放的服务和端口,这对于安全评估、渗透测试等有着不可忽视的作用,本文将介绍如何使... 目录1. 端口扫描的基本原理2. 使用python实现端口扫描2.1 安装必要的库2.2 编写端口扫

使用Python实现操作mongodb详解

《使用Python实现操作mongodb详解》这篇文章主要为大家详细介绍了使用Python实现操作mongodb的相关知识,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录一、示例二、常用指令三、遇到的问题一、示例from pymongo import MongoClientf