Re: [GENERAL] timespan
| От | A James Lewis |
|---|---|
| Тема | Re: [GENERAL] timespan |
| Дата | |
| Msg-id | Pine.LNX.3.93.981106084859.15033E-100000@vr1-workhorse1.vrtx.net обсуждение исходный текст |
| Ответ на | timespan (Bob Dusek <bobd@palaver.net>) |
| Список | pgsql-general |
I'm by no means experienced.... but I'm using this to convert epoch time
to a date field... (INT4 is BAD, but 6.3.2 doesn't have int8 yet....)
datetime_pl_span('1970-01-01 0:0:0'::datetime, text_timespan(int4_text(exp_date)))
This, converts time to epoch,
select date_part('epoch', now()::datetime);
SO!
HOW ABOUT,
date_part('epoch', datetime_pl_span('1970-01-01 0:0:0'::datetime, your_value::timespan));
Way I see it, this returns span time in seconds, so long as the span is
less than 68 years?
Anyone got a better solution?
On Thu, 5 Nov 1998, Bob Dusek wrote:
> Hey there,
>
> I've got a more simplified version of a previous question I asked:
>
> does anyone know how to take a value of type timespan and convert it
> into a single float8 or int value?
>
> I'm really having a time with this and I haven't been able to come up
> with a solution, thus far. Some experienced assistance would be very
> appreciated.
>
> Thank you much,
>
> Bob
>
James (james@linuxrocks.co.uk)
Vortex Internet
My Windows unders~1 long filena~1, and yours?
В списке pgsql-general по дате отправления: