Book Contents

Book Index

Next Topic

Home

TIMESTAMP

TIMESTAMP consists of a date and a time with or without a time zone and with or without an historical epoch (AD or BC).

Syntax

TIMESTAMP [ (p) ] [ { WITH | WITHOUT } TIME ZONE ] | TIMESTAMPTZ

[ AT TIME ZONE ]

Semantics

p

(precision) specifies the number of fractional digits retained in the seconds field. By default, there is no explicit bound on precision. The allowed range 0 to 6.

WITH TIME ZONE

specifies that valid values must include a time zone. All TIMESTAMP WITH TIMEZONE values are stored internally in UTC. They are converted to local time in the zone specified by the timezone configuration parameter before being displayed to the client.

WITHOUT TIME ZONE

specifies that valid values do not include a time zone (default). If a time zone is specified in the input it is silently ignored.

TIMESTAMPTZ

is the same as TIMESTAMP WITH TIME ZONE with no precision

Limits

 

Data Type

Low Value

High Value

Resolution

TIMESTAMP [ (p) ] [ WITHOUT TIME ZONE ]

4713 BC

5874897 AD

1 MS / 14 digits

TIMESTAMP [ (p) ] WITH TIME ZONE

4713 BC

5874897 AD

1 MS / 14 digits

Notes

Examples

1999-01-08 04:05:06

1999-01-08 04:05:06 -8:00

January 8 04:05:06 1999 PST