使用Neo4j Javascript驱动程序,存储的日期时间值为
2018-10-22T13:17:02.305000000Z将64位表示形式返回为:
DateTime {
year: Integer { low: 2018, high: 0 },
month: Integer { low: 10, high: 0 },
day: Integer { low: 22, high: 0 },
hour: Integer { low: 13, high: 0 },
minute: Integer { low: 17, high: 0 },
second: Integer { low: 2, high: 0 },
nanosecond: Integer { low: 305000000, high: 0 },
timeZoneOffsetSeconds: Integer { low: 0, high: 0 },
timeZoneId: null
}但当使用moment.js进行转换时,其结果是提前一个月的值:
2018-11-22T13:17:02.000Z 如果我尝试使用Neo4j JS驱动程序将timestamp对象从64位转换为:
var convert = neo4j.int(timestamp);convert值变为:
Integer { low: 0, high: 0 }
因此,convert.toInt()、convert.toString()和convert.toString()都会产生值:0
如何使用Neo4j Javascript驱动程序将64位日期时间转换为准确的32位ISO日期字符串?
发布于 2018-10-22 23:14:01
使用原生javascript日期转换new Date()进行测试时,它返回:
2018-10-22T13:17:02.305Z
而不是返回moment.js:
2018-11-22T13:17:02.000Z
所以看起来moment.js可能有一个64位转换的bug。
https://stackoverflow.com/questions/52932498
复制相似问题