-1

Does anyone know of a way of concatenating millis into an HHH:MM:SS format? Where the hours can go over 24:59:59, but not add another day (as in 1970-01-02 00:00:01). I'd like it to show as 25:00:01 for example.

I can split the time up and concatenate it, but it's a dynamic timeframe, and I wish for the seconds to jump over to minutes etc.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
ah1
  • 71
  • 3
  • 9
  • Do you know how to do **with** days? If so, drop the day-part of calculations. – PM 77-1 May 25 '18 at 13:35
  • I'm doing it this way, and dropping the date part doesn't solve it unfortunately:("timestampadd"('ms', sum(totaltime::int), '1970-01-01 00:00:00+00'::timestamptz))::timestamp – ah1 May 25 '18 at 13:50
  • I mean you will need to do something like [this](https://stackoverflow.com/a/45146964/2055998) without removing whole days. – PM 77-1 May 25 '18 at 14:18

1 Answers1

0

Just use in INTERVAL HOUR TO SECOND data type:

daniel=> select '25:59:59'::INTERVAL HOUR TO SECOND + 16::INTERVAL SECOND;
 ?column? 
----------
 26:00:15
(1 row)
sKwa
  • 889
  • 5
  • 11