From: | Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> |
---|---|
To: | Ange Michel POZZO <poange(at)technologist(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: a question about dates and timestamp |
Date: | 2000-08-03 10:39:31 |
Message-ID: | Pine.LNX.3.96.1000803122838.31239E-100000@ara.zf.jcu.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Thu, 3 Aug 2000, Ange Michel POZZO wrote:
> Le jeu, 03 aoű 2000, Karel Zak a écrit :
> > > my question is how can i convert the numeric or the int4 value to
> > > a date value?
> >
> >
> > test=# select abstime(965293003);
> > abstime
> > ------------------------
> > 2000-08-03 10:56:43+02
> > (1 row)
> >
> > Karel
>
>
> this is the result of the query for me :
>
> test=> select abstime(965293003);
> ?column?
> ---------
> 965293003
> (1 row)
Ooops I use CVS version, but you have probably 6.5...
Sorry, Now I haven't time check what is 7.1 / 7.0 / 6.5 feature.
in current code:
test=# select '965293003.000001'::int;
ERROR: pg_atoi: error in "965293003.000001": can't parse ".000001"
test=# select '965293003.000001'::numeric(9, 0);
?column?
-----------
965293003
(1 row)
test=# select '965293003.000001'::numeric(9, 0)::int;
?column?
-----------
965293003
(1 row)
test=# select abstime('965293003.000001'::numeric(9, 0)::int);
abstime
------------------------
2000-08-03 10:56:43+02
(1 row)
BTW. The postgreSQL has good date/time support; why you use slow and
expensive numeric?
From | Date | Subject | |
---|---|---|---|
Next Message | The Hermit Hacker | 2000-08-03 11:41:26 | Re: What is happening? |
Previous Message | Ange Michel POZZO | 2000-08-03 09:30:31 | Re: a question about dates and timestamp |