Re: [GENERAL] Converting seconds past midnight to a time

2005-12-19 Thread Karl O. Pinc
On 12/19/2005 04:11:09 PM, Jim C. Nasby wrote: Another option would be creating a set of timestamp math functions; that would probably help cut down on the number of questions about this. I solved it by converting to numeric. Here's my functions. (I haven't tested the spm (seconds past mid

Re: [GENERAL] Converting seconds past midnight to a time

2005-12-19 Thread Jim C. Nasby
On Sun, Dec 18, 2005 at 07:29:45AM +, Karl O. Pinc wrote: > > On 12/17/2005 10:21:39 PM, Michael Glaesemann wrote: > > > >On Dec 18, 2005, at 13:25 , Karl O. Pinc wrote: > >>On a related note is there some reason why > >>interval + int > >>does not result in the interval plus int number > >>of

Re: [GENERAL] Converting seconds past midnight to a time

2005-12-17 Thread Karl O. Pinc
On 12/17/2005 10:21:39 PM, Michael Glaesemann wrote: On Dec 18, 2005, at 13:25 , Karl O. Pinc wrote: On a related note is there some reason why interval + int does not result in the interval plus int number of seconds? Why should the int necessarily represent seconds and not some other amo

Re: [GENERAL] Converting seconds past midnight to a time

2005-12-17 Thread Tom Lane
"Karl O. Pinc" <[EMAIL PROTECTED]> writes: > What is the best way to convert an integer number of > seconds past midnight into a time? Intermediate 'interval' value seems to work: regression=# select (99.44 * '1 second'::interval)::time; time - 00:01:39.44 (1 row) > On a re

Re: [GENERAL] Converting seconds past midnight to a time

2005-12-17 Thread Michael Glaesemann
On Dec 18, 2005, at 13:25 , Karl O. Pinc wrote: What is the best way to convert an integer number of seconds past midnight into a time? Try your_date::timestamptz + your_seconds * interval '1 sec', e.g., test=# select current_date::timestamptz, current_date::timestamptz + 1000 * interval '