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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/786051.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C++ vector 数组/向量

文章目录 【 1. vector 的声明与初始化 】1.1 vector 的声明1.2 vector 的初始化1.2.1 构造一个空的 vector1.2.2 指定数量初值的方式初始化 vector1.2.3 迭代器的方式初始化1.2.4 构造一个相同的 vector 【 2. vector 的相关操作 】2.1 插入元素2.1.1 在vector的末尾插入新元素…

IPv4地址

IP v4 由32位二进制构成、可以用点分十进制表示。 例如:192.168.1.1 11000000101010000000000100000001 由网络位和主机位组成。为了区分网络位和主机位,需要用子网掩码,子网掩码也是由32位二进制构成,连续的1对应网络位&#…

HDMI 2.1b 规范解读

HDMI 规范 HDMI 2.1b 是最新版 HDMI 规范,支持一系列更高的视频分辨率和刷新频率,包括 8K60 和 4K120 以及高达 10K 的分辨率。同时支持动态 HDR 格式,带宽能力增加到 48Gbps HDMI。 新的超高速 HDMI 线缆支持 48Gbps 带宽。该线缆可确保提供…

吴恩达机器学习笔记 三十二 K-means初始化 选择聚类数量

K-means 初始化 首先 K < m&#xff0c;若集群的数量多于样本数显然是不合理的。 第一步&#xff1a;随机选取 K 个样本&#xff1b; 第二步&#xff1a;设这 K 个样本为 μ1 μ2 ... μk 有时候K-meas 算法会出现局部最小值的情况&#xff0c;如左下图和右下图&#xf…

spark sql执行引擎原理及配置

如果我们想要给上层开发人员配置好一个统一的sql开发界面&#xff0c;让他们统一通过sql开发即可&#xff0c;可通过spark中的thriftserver服务实现&#xff0c;与hive中的thriftserver类似&#xff0c;配置好该服务后&#xff0c;上层通过db client或者代码中通过jdbc连接即可…

Linux gcc day2

mkdir -p 递归的创建目录 rm or rmdir&#xff1a; rmdir &#xff1a;是用来删除空目录的 实际上我们更加常用的是rm命令 rm可以删除普通文件,也可以删除目录&#xff0c;目录是从某次开始就是一棵树就是递归&#xff0c;所以就要递归删除 rm -r [文件名] 递归删除目录或者目…

linux系统命令chkconfig详解,管理系统服务的工具-查看、启用、禁用和设置系统服务的启动级别

目录 一、chkconfig命令介绍 二、命令的主要作用 1、管理服务的启动和停止&#xff1a; 2、配置运行级别&#xff1a; 3、简化系统管理&#xff1a; 4、查看服务状态&#xff1a; 三、命令语法 1、基本语法 2、运行级别 四、获取帮助 1、通过help获取 2、通过man获…

基于“遥感+”蓝碳储量估算、红树林信息提取实践技术应用与科研论文写作

原文链接&#xff1a;基于“遥感”蓝碳储量估算、红树林信息提取实践技术应用与科研论文写作https://mp.weixin.qq.com/s?__bizMzUzNTczMDMxMg&mid2247599633&idx5&sn1398cde523f9c5e036e4d478fc1d3388&chksmfa8207f6cdf58ee0a3a2bf652e7ac5cf65636b05f9e3306…

备战蓝桥杯Day36 - 动态规划 - 三角形最小路径和问题

一、什么是动态规划 通过拆分问题&#xff0c;定义问题状态和状态之间的关系&#xff0c;使得问题能够以递推的方式解决。 哪些问题可以使用动态规划&#xff1f; 1、具有最优子结构&#xff1a;问题的最优解所包含的子结构的解也是最优的 2、具有无后效性&#xff1a;未来…

java项目依赖的依赖加载不到

1、描述&#xff1a; 一个项目包含多个子模块&#xff0c;并且可以根据profiles切换环境。 然后依赖的依赖就是加载不到 上面flow-es-6.8是我封装的一个环境。 2、解决: profiles里要加上默认一个环境配置,如下红色部分&#xff1a; 虽然我在idea右边maven中的profiles选项…

【ElementUI】详细分析DatePicker 日期选择器

目录 前言1. 通用Demo2. 快捷键3. 参数 前言 对于全栈玩家&#xff0c;各个组件都需相应了解才可做好前后端的CRUD 以下为实战结合Element官网的心得体会 如图所示&#xff1a; 1. 通用Demo 如果只想要一个选择日期&#xff0c;而不是范围&#xff0c;Demo如下&#xff1a;…

Docker搭建LNMP环境实战(09):安装mariadb

1、编写mariadb部署配置文件 在文件夹&#xff1a;/mnt/hgfs/dockers/test_site/compose下创建文件&#xff1a;test_site_mariadb.yml&#xff0c;内容如下&#xff1a; version: "3.5" services:test_site_mariadb:container_name: test_site_mariadbimage: mari…

逐步学习Go-Select多路复用

概述 这里又有多路复用&#xff0c;但是Go中的这个多路复用不同于网络中的多路复用。在Go里&#xff0c;select用于同时等待多个通信操作&#xff08;即多个channel的发送或接收操作&#xff09;。Go中的channel可以参考我的文章&#xff1a;逐步学习Go-并发通道chan(channel)…

Gparted工具 初始化磁盘

Gparted工具 初始化磁盘 1、安装 没有此工具请先安装&#xff1a; yum install epel-release yum install gparted yum install yum-utils git gnome-common gcc-c yum-builddep gparted 2、打开Gparted工具&#xff0c;初始化磁盘 使用具有root权限的普通用户打开gparted&…

HWOD:整型数组排序

一、知识点 while(1){}表示永久循环 使用break结束循环 二、题目 1、描述 输入整型数组和排序标识&#xff0c;对其元素按照升序或降序进行排序 2、数据范围 1<n<1000 0<val<100000 3、输入 第一行输入数组元素个数 第二行输入待排序的数组&#x…

电商技术揭秘二:电商平台推荐系统的实现与优化

文章目录 一、推荐系统的重要性1.1 提升用户体验1.1.1 个性化推荐增强用户满意度1.1.2 减少用户选择困难 1.2 增加销售额1.2.1 促进交叉销售和捆绑销售1.2.2 提高用户购买转化率 1.3 数据分析与用户行为理解1.3.1 挖掘用户偏好和购买习惯1.3.2 为产品开发和库存管理提供数据支持…

npm ERR! code CERT_HAS_EXPIRED 淘宝镜像失效

近期vue安装失败&#xff0c;具体如下&#xff1a; 1.先npm cache clean --force 再下载 插件后缀加上 --legacy-peer-deps 2.certificate has expired npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.npm.taobao.o…

Windows安装禅道系统结合Cpolar实现公网访问内网BUG管理服务

文章目录 前言1. 本地安装配置BUG管理系统2. 内网穿透2.1 安装cpolar内网穿透2.2 创建隧道映射本地服务3. 测试公网远程访问4. 配置固定二级子域名4.1 保留一个二级子域名5.1 配置二级子域名6. 使用固定二级子域名远程 前言 BUG管理软件,作为软件测试工程师的必备工具之一。在…

943: 顺序表插入操作的实现

学习版 【C语言】 需要扩充数组 【C】 #include <iostream> #include <vector> #include <algorithm> using namespace std; class MyLinkedList { public:struct LinkedNode{int val;LinkedNode* next;LinkedNode(int x) :val(x), next(NULL) {}};MyLin…

TypeScript语法快速上手

TypeScript语法 对比ts编译器类型注解新增类型数组自定义类型注解函数类型对象类型元组类型类型推断枚举类型 对比 最大区别&#xff1a;ts能在编译时就能发现类型错误的问题&#xff0c;而js只有在系统运行时再通过异常中断来发现 ts的底层仍是js&#xff0c;但ts能够有效减少…