RE: [GENERAL] tinterval and timespan - Mailing list pgsql-general

From Jackson, DeJuan
Subject RE: [GENERAL] tinterval and timespan
Date
Msg-id F10BB1FAF801D111829B0060971D839F2B44D2@cpsmail
Whole thread Raw
Responses Re: [GENERAL] tinterval and timespan
List 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

pgsql-general by date:

Previous
From: Harry Biltz
Date:
Subject: unixware 2.1.2
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [GENERAL] Problem with curses