如何将时间间隔转换为“1天01:30:00”到“25:30:00”? [英] How to convert an interval like "1 day 01:30:00" into "25:30:00"?

查看:241
本文介绍了如何将时间间隔转换为“1天01:30:00”到“25:30:00”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要添加一些时间间隔并在Excel中使用结果。

由于

  sum(time.endtime-time.starttime) 

返回间隔为1 day 01:30:00,这种格式会打破我的Excel工作表,我认为有这样的输出像25:30:00,但在PostgreSQL文档中找不到方法。



任何人都可以帮我解决这个问题吗?

不是一个确切的解决方案的主题:

  => SELECT date_part('epoch',INTERVAL'1 day 01:30:00')* INTERVAL'1 second'hours; 
小时
-----------
25:30:00
(1 row)

资料来源:文件


I need to add some intervals and use the result in Excel.

Since

sum(time.endtime-time.starttime)

returns the interval as "1 day 01:30:00" and this format breaks my Excel sheet, I thought it'd be nice to have the output like "25:30:00" but found no way to do it in the PostgreSQL documentation.

Can anyone here help me out?

解决方案

Since there is not an exact solution for the topic:

=> SELECT date_part('epoch', INTERVAL '1 day 01:30:00') * INTERVAL '1 second' hours;
  hours
-----------
 25:30:00
(1 row)

Source: Documentation

这篇关于如何将时间间隔转换为“1天01:30:00”到“25:30:00”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆