【问题标题】:DolphinDB Calculate the time difference between TIMESTAMP and DATETIME?DolphinDB计算TIMESTAMP和DATETIME的时间差?
【发布时间】:2021-12-29 08:29:12
【问题描述】:

我在 DolphinDB 中尝试了脚本:

t =table(
array(DATETIME, 0) as MDTime,
array(TIMESTAMP, 0) as ReceivedTime
)
share t as testShareTable;
select * from testShareTable;
select avg(ReceivedTime - MDTime) as DelayTime from testShareTable;

桌子是

但输出却不如预期

对修改代码有什么建议吗?顺便说一句,我想为 ReceivedTime 增加 8 小时。如何获得结果?

【问题讨论】:

    标签: time dolphindb


    【解决方案1】:

    修改最后一行代码:

    select avg(temporalAdd(ReceivedTime,8H) - timestamp(MDTime)) as DelayTime from testShareTable;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-04
      • 1970-01-01
      相关资源
      最近更新 更多