Skip to content

MAKE_TIMESTAMPTZ

Make a TIMESTAMP WITH TIME ZONE value from a series of datetime values, including an optional text field for the time zone.

MAKE_TIMESTAMPTZ(year, month, day, hour, minute, seconds [, 'timezone'])
  • The year, month, day, hour, and minute values are integers.
  • The seconds value is a double precision number.
  • The timezone is a string.

For example:

premdb=# INSERT INTO timezone VALUES
(MAKE_TIMESTAMPTZ(2013, 7, 15, 8, 15, 23.5, 'GMT'));
INSERT 0 1
premdb=# SELECT * FROM timezone;
          tstz           
--------------------------
 2013-07-15 01:15:23.5-07
(1 row)

Parent topic:Datetime Functions