Re: Frustration with date/times/epoch in v7.3.

From: Mike Benoit <mikeb(at)netnation(dot)com>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: Peter Gibbs <peter(at)emkel(dot)co(dot)za>, pgsql-general(at)postgresql(dot)org
Subject: Re: Frustration with date/times/epoch in v7.3.
Date: 2002-12-12 21:44:32
Message-ID: 1039729472.12433.60.camel@mikeb.staff.netnation.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2002-12-12 at 12:23, Jean-Luc Lachance wrote:
> Why not simply use '99991231'::date ?
>

select imported_date, imported_date::date from server_accounts;
ERROR: Cannot cast type integer to date
select imported_date, 'imported_date'::date from server_accounts;
ERROR: Bad date external representation 'imported_date'

Thats why. ;)

> Mike Benoit wrote:
> >
> > Thanks Peter, abstime() seems to do the trick. However this paragraph
> > from the docs worries me:
> >
> > "The types abstime and reltime are lower precision types which are used
> > internally. You are discouraged from using any of these types in new
> > applications and are encouraged to move any old ones over when
> > appropriate. Any or all of these internal types might disappear in a
> > future release."
> >
> > So does this mean that the abstime() functions may dissappear in the
> > future? I'd rather not have to go through and change all my queries yet
> > again, is there a function that has a better chance of being around in
> > the near future that I could use instead?
> >
> > On Thu, 2002-12-12 at 09:59, Peter Gibbs wrote:
> > > Mike Benoit wrote:
> > >
> > > > select imported_date, ('Jan 1 1970'::DATE + (imported_date || '
> > > seconds')::INTERVAL)::timestamp from server_accounts limit 1
> > > > imported_date | timestamp
> > > > ---------------+---------------------
> > > > 1027966107 | 2002-07-29 18:08:27
> > >
> > > test=> select imported_date, abstime(imported_date) from server_accounts;
> > > imported_date | abstime
> > > ---------------+------------------------
> > > 1037498593 | 2002-11-17 04:03:13+02
> > > 1027966107 | 2002-07-29 20:08:27+02
> > >
> > > --
> > > Peter Gibbs
> > > EmKel Systems
> > --
> > Best Regards,
> >
> > Mike Benoit
> > NetNation Communication Inc.
> > Systems Engineer
> > Tel: 604-684-6892 or 888-983-6600
> > ---------------------------------------
> >
> > Disclaimer: Opinions expressed here are my own and not
> > necessarily those of my employer
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
--
Best Regards,

Mike Benoit
NetNation Communication Inc.
Systems Engineer
Tel: 604-684-6892 or 888-983-6600
---------------------------------------

Disclaimer: Opinions expressed here are my own and not
necessarily those of my employer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-12-12 21:52:42 Re: Frustration with date/times/epoch in v7.3.
Previous Message Aravind Vinnakota 2002-12-12 21:41:02 client for solaris