RE: [GENERAL] tinterval and timespan

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: wr(at)tribe(dot)ping(dot)de, pgsql-general(at)postgreSQL(dot)org
Subject: RE: [GENERAL] tinterval and timespan
Date: 1998-06-01 20:19:25
Message-ID: F10BB1FAF801D111829B0060971D839F2B44D2@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I am still having problems with the timespan and tinterval types.
>
> tinterval is defined as (abstime, abstime) but if set a value like
> ('2/2/1998, 2/2/1999') the result returned will be
>
> ["Thu Jan 01 01:04:06 1970 MET" "Thu Apr 25 07:54:08 1974 MET"]
>
> timespan seems also worthless for me. I can define a timespan of
> years,
> hours etc. but I am not able to use it as a time range starting from a
> certain time. E. g. i would like to have a time range of 3 years
> starting
> in 1998 and ending in year 2000. If i enter a value of '1998 years @
> 2000
> years' the resulting value will be '@ 3998'.
>
> Could anyone give me a hint how to use these data types succesfully?
> Are
> there any examples around?
try (without the line break):
select '["Mon Jun 01 15:11:21 1998 EDT" "Mon Jun 08 15:11:21 1998
EDT"]'::tinterval;
This might help you, too:
select NOW()::DATETIME::ABSTIME;

> Werner
>
Hope this helps,
-DEJ

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jackson, DeJuan 1998-06-01 20:39:13 RE: [GENERAL] Problem with curses
Previous Message Harry Biltz 1998-06-01 20:04:14 unixware 2.1.2