【问题标题】:how to do sec_to_time in SQLite?如何在 SQLite 中执行 sec_to_time?
【发布时间】:2019-02-01 23:54:07
【问题描述】:

我在午夜后有一个字段,我必须将其转换为 HH:MM:SS。 MySQL 有 sec_to_time(),这将是完美的,但 SQLite 没有。

如何转换?

我觉得它是 strftime 或 date 的某种组合,还有一些除以 3600,但我无法理解。

例如,我需要将 3601 转换为 1:01。或者,32405 -> 9:05。

【问题讨论】:

    标签: sqlite time milliseconds seconds


    【解决方案1】:

    使用time()

    select time(3601, 'unixepoch');
    

    将给予:

    01:00:01
    

    【讨论】:

      猜你喜欢
      • 2019-07-08
      • 2020-07-18
      • 2012-08-18
      • 2019-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多