Converting seconds past midnight to a time

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Converting seconds past midnight to a time
Date: 2005-12-18 04:25:05
Message-ID: 1134879905l.18569l.7l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Hi,

What is the best way to convert an integer number of
seconds past midnight into a time? I can't seem to
figure out a way that does not involve casts to strings,
which seems wasteful.

On a related note is there some reason why
interval + int
does not result in the interval plus int number
of seconds? That would seem the sane approach.
So sane that there must be some reason why it's
not already done.

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-18 04:26:25 Re: Converting seconds past midnight to a time
Previous Message Michael Glaesemann 2005-12-18 04:21:39 Re: Converting seconds past midnight to a time

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-12-18 04:26:25 Re: Converting seconds past midnight to a time
Previous Message Michael Glaesemann 2005-12-18 04:21:39 Re: Converting seconds past midnight to a time