From: | Bob Dusek <bobd(at)palaver(dot)net> |
---|---|
To: | A James Lewis <james(at)vrtx(dot)net> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: [GENERAL] timespan |
Date: | 1998-11-06 21:15:07 |
Message-ID: | 364366DB.53DB771F@palaver.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Here's to Ulf and James,
Thanks! (a lot)
Your time and help is very, well... helpful.
Bob
A James Lewis wrote:
>
> 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?
From | Date | Subject | |
---|---|---|---|
Next Message | Dustin Sallings | 1998-11-06 22:15:50 | max(), datetimes, and indexes |
Previous Message | Bill Moore | 1998-11-06 19:35:34 | 6.1 vs 6.3.2 performance |