Re: [GENERAL] timespan

From: A James Lewis <james(at)vrtx(dot)net>
To: Bob Dusek <bobd(at)palaver(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] timespan
Date: 1998-11-06 08:55:17
Message-ID: Pine.LNX.3.93.981106084859.15033E-100000@vr1-workhorse1.vrtx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)linuxrocks(dot)co(dot)uk)
Vortex Internet
My Windows unders~1 long filena~1, and yours?

In response to

  • timespan at 1998-11-06 02:49:49 from Bob Dusek

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adriaan Joubert 1998-11-06 12:00:58 pg_hba.conf woes
Previous Message Ulf Mehlig 1998-11-06 08:35:05 Re: [GENERAL] timespan