Date and Time Functions

Current

For examples of the following, see CURRENT TIME FUNCTIONS.

Name Return Type Description
current_date date Current date
current_timestamp timestamp with time zone* Current date and time (start of current transaction)
localtime time Current time of day
localtimestamp timestamp Current date and time (start of current transaction)
now() timestamp with time zone* Current date and time (start of current transaction)
statement_timestamp() timestamp with time zone* Current date and time (start of current statement)

Drizzle timezone is always UTC.

Extract

For examples of the following, see EXTRACT DATE FUNCTION.

Name Return Type Description
extract(field from timestamp) double precision Get subfield
extract(field from interval) double precision Get subfield
date_part(text, timestamp) double precision Get subfield (equivalent to extract)
date_part(text, interval) double precision Get subfield (equivalent to extract)

DATE TRUNC

For an example of the following, see DATE TRUNC.

Name Return Type Description
date_trunc(text, timestamp) timestamp Truncate to specified precision

Table Of Contents

Previous topic

Mathematical Operators and Functions

Next topic

CURRENT TIME FUNCTIONS

This Page