Add information regarding date and time types and functions,

including arguments allowed.
This commit is contained in:
Thomas G. Lockhart 1997-07-02 14:13:14 +00:00
parent 54c38a95ee
commit 75ebaa748e
1 changed files with 60 additions and 51 deletions

View File

@ -1,6 +1,6 @@
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.7 1997/05/16 07:13:46 thomas Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.8 1997/07/02 14:13:14 thomas Exp $
.TH BUILT-INS INTRO 04/01/97 PostgreSQL PostgreSQL
.SH "DESCRIPTION"
This section describes the data types, functions and operators
@ -82,7 +82,11 @@ several possibilities for formats, such as date and time types.
Some date and time types share code for data input. For those types (currently
.IR datetime
and
.IR abstime )
.IR abstime
, and
.IR timespan
and
.IR reltime )
the input can have any of a wide variety of styles. For numeric date representations,
European and US conventions can differ, and the proper interpretation is obtained
by using the
@ -129,22 +133,22 @@ offsets to GMT (e.g. "-08" or "-08:00" when in Pacific Standard Time).
Dates are stored internally in Greenwich Mean Time. Input and output routines
translate time to the local time zone of the server.
.PP
All special values allowed for
.IR "absolute time"
are also allowed for
.IR "datetime".
The special values \*(lqcurrent\*(rq,
\*(lqinfinity\*(rq and \*(lq-infinity\*(rq are provided.
\*(lqinfinity\*(rq specifies a time later than any valid time, and
\*(lq-infinity\*(rq specifies a time earlier than any valid time.
\*(lqcurrent\*(rq indicates that the current time should be
The special values `current',
`infinity' and `-infinity' are provided.
`infinity' specifies a time later than any valid time, and
`-infinity' specifies a time earlier than any valid time.
`current' indicates that the current time should be
substituted whenever this value appears in a computation.
.PP
The strings \*(lqnow\*(rq and \*(lqepoch\*(rq can be used to specify
time values. \*(lqnow\*(rq means the current time, and differs from
\*(lqcurrent\*(rq in that the current time is immediately substituted
for it. \*(lqepoch\*(rq means Jan 1 00:00:00 1970 GMT.
The strings
`now',
`today',
`yesterday',
`tomorrow',
and `epoch' can be used to specify
time values. `now' means the current time, and differs from
`current' in that the current time is immediately substituted
for it. `epoch' means Jan 1 00:00:00 1970 GMT.
.SH "TIMESPAN"
General-use time span is input using a wide range of
@ -165,10 +169,10 @@ Time span is specified with the following syntax:
@ Quantity Unit [Direction]
.sp
where
Quantity is ..., '-1', '0', `1', `2', ...
Quantity is ..., `-1', `0', `1', `2', ...
Unit is `second', `minute', `hour', `day', `week', `month', `year',
or abbreviations or plurals of these units.
Direction is ``ago''
Direction is `ago'.
.fi
.SH "ABSOLUTE TIME"
Absolute time (abstime) is a limited-range (+/- 68 years) and limited-precision (1 sec)
@ -196,17 +200,10 @@ Valid dates are from Dec 13 20:45:53 1901 GMT to Jan 19 03:14:04
using Greenwich Mean Time; the input and output routines default to
the local time zone.
.PP
The special absolute time values \*(lqcurrent\*(rq,
\*(lqinfinity\*(rq and \*(lq-infinity\*(rq are also provided.
\*(lqinfinity\*(rq specifies a time later than any valid time, and
\*(lq-infinity\*(rq specifies a time earlier than any valid time.
\*(lqcurrent\*(rq indicates that the current time should be
substituted whenever this value appears in a computation.
.PP
The strings \*(lqnow\*(rq and \*(lqepoch\*(rq can be used to specify
time values. \*(lqnow\*(rq means the current time, and differs from
\*(lqcurrent\*(rq in that the current time is immediately substituted
for it. \*(lqepoch\*(rq means Jan 1 00:00:00 1970 GMT.
All special values allowed for
.IR "datetime"
are also allowed for
.IR "absolute time".
.SH "RELATIVE TIME"
Relative time (reltime) is a limited-range (+/- 68 years) and limited-precision (1 sec)
@ -506,6 +503,16 @@ tinterval
.SH "FUNCTIONS"
Many data types have functions available for conversion to other related types.
In addition, there are some type-specific functions.
.PP
For the
date_part() and date_trunc()
functions, arguments can be
`year', `month', `day', `hour', `minute', and `second',
as well as the more specialized quantities
`decade', `century', `millenium', `millisecond', and `microsecond'.
date_part() also allows
`dow'
to return day of week and `epoch' to return seconds since 1970.
.nf
Functions:
@ -521,6 +528,7 @@ date
datetime
abstime abstime(datetime) convert to abstime
float8 date_part(text,datetime) specified portion of date field
datetime date_trunc(text,datetime) truncate date at specified units
bool isfinite(datetime) TRUE if this is a finite time
reltime
@ -550,6 +558,7 @@ circle
float8 diameter(circle) diameter of circle
float8 area(circle) area of circle
.fi
.SH "BINARY OPERATORS"
This list was generated from the Postgres system catalogs with the
query: