计算通话时长
我在电信工作,我需要计算通话的通话时长。问题是我们有世界时间 24 小时(00:00:00 - 23:59:59)例如,现在通话从 22:31:40 开始并于 00:22:56 结束 现在我需要计算这次通话的持续时间。我可以知道计算它的逻辑吗
提前致谢
i am working for telecom,i need to calculate call duration of a call.the issue is we have world time 24hrs(00:00:00 - 23:59:59)for example, now the call starts at 22:31:40 and ends at 00:22:56
now i need to calculate the duration of this call. can i know the logic to calculate it
Thanks In advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DB2 没有内置函数可以执行此操作。但是,DB2 DATE 文档 包含用户定义的函数,它使用 DAYS() 和 MIDNIGHT_SECONDS() 来实现所需的结果。
There is no DB2 built-in function to do this. However, the DB2 DATE documentation includes the source for a user-defined function which employs DAYS() and MIDNIGHT_SECONDS() to achieve the required result.
第二次加上 24 小时,然后从第一次减去。如果结果大于 24 小时,则取出 24 小时。这显然不能处理超过 24 小时的呼叫,但我们假设它们不是。
...或者使用一些我不知道的 DB2 函数。
Add 24 hours to the second time and subtract from the first. If the result is greater than 24 hours, take the 24 back out. This obviously doesn't handle calls that ARE over 24 hours, but we'll assume they arent.
... or use some DB2 function I'm unaware of.