【问题标题】:How to convert the time column in int type to 23:53:20.081?如何将int类型的时间列转换为23:53:20.081?
【发布时间】:2021-05-21 02:04:56
【问题描述】:

如何将int类型的时间列转换为23:53:20.081?

现在,我将时间列设置为 int 类型,例如:a = 95200820 表示时间 09:25:00.820,b = 192500820 表示时间 19:25:00.820。在dolphindb中,如何将int类型转换为正确的时间类型?

【问题讨论】:

    标签: dolphindb


    【解决方案1】:

    首先使用“string()”函数将类型从int转换为string,然后使用“lpad()”函数将指定字符填入左侧,再使用“temporalParse”函数将将其转换为 dolphindb 中的时间类型。 具体例子如下:

    b = 92500820
    datetimeParse(lpad(string(b), 9, "0"), "HHmmssSSS")
    

    结果是:

    09:25:00.820
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-12
      • 1970-01-01
      • 2018-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多