neo4j - 在查询中计算开始时间和结束时间之间的分钟差
问题描述
我是 Neo4j 社区的新手。所以我有以下问题:如何在查询中计算两个属性“开始时间”和“结束时间”(均为数据类型 DateTime)之间的分钟差?谢谢
解决方案
你想要做的是计算 a Duration
between two DateTime
。
为了做到这一点,duration
Neo4j 中的函数duration.inSeconds
会为您提供持续时间。然后你可以通过调用来获得分钟数.minutes
。
这是一个例子:
WITH datetime() AS now, datetime('2017-09-17T12:50:35.556+0100') AS date
RETURN duration.inSeconds(date, now).minutes
干杯
推荐阅读
- javascript - 如何向api发送数据
- excel - 如何在代码中选择多个特定选项卡而不是选项卡名称
- asp.net-mvc - 如何在本地数据库中存储 IdentityServer 令牌
- c - 如何在不使用类型转换的情况下将 uint32 位数据类型转换为 sint64 位数据?
- postman - 自动任务邮递员电话
- websocket - 在 AWS ApiGateway 中设置基本的 WebSocket 模拟
- c# - 即使指定了多个文件上传,IFormFile IEnumerable 的大小也为 1
- python - 将属性分配给方法
- cs50 - CS50 Recover 运行并恢复除第一个文件之外的所有文件
- javascript - 如何在Javascript中实现具有固定增量的可调整大小的div?