make_time()

A function for creating a time from individual values

make_time() is a system function  for assembling a time value from the hour, minute and second.

make_time() was added in PostgreSQL 9.4.

Usage

make_time ( hour int, min int, sec double precision ) → time

An error is raised if any of the provided parameters is invalid.

Change history

Examples

Basic usage example for make_time():

postgres=# SELECT make_time(13, 10, 2.5);
 make_time  
------------
 13:10:02.5
(1 row)

Providing one or more invalid parameters:

postgres=# SELECT make_time(25, 10, -11);
ERROR:  time field value out of range: 25:10:-11

Categories

Date and time, System function

See also

make_date(), make_timestamp(), make_timestamptz(), make_interval()