在 PostgreSQL 中证明秒数(整数)到日期格式(超过几天和几个月)

Justify seconds (integer number) to date format (more than days and months) in PostgreSQL

我想知道如何证明日期格式 HH:MM:SS 天:月的大数字(百万秒)是合理的:同时年。在 PostgreSQL 9.4

中使用 SQL 查询

Example : 1 000 000 Seconds = 11 days 13 hours 46 minute 40 seconds.

谢谢

test=> SELECT justify_hours(INTERVAL '1000000 s');
┌──────────────────┐
│  justify_hours   │
├──────────────────┤
│ 11 days 13:46:40 │
└──────────────────┘
(1 row)

您可以使用 justify_interval 而不是 justify_hours 来获取月份和年份,但是一个月有多少天?