PostgreSQL Date/Time Functions
14 functions
NOWNOW()Returns the current date and time.
CURRENT_DATECURRENT_DATEReturns the current date.
CURRENT_TIMECURRENT_TIMEReturns the current time.
CURRENT_TIMESTAMPCURRENT_TIMESTAMPReturns the current timestamp.
EXTRACTEXTRACT(field FROM source)Extracts a specific field from a date/time value.
DATE_PARTDATE_PART('field', source)Returns a specific field of a date/time as a number.
DATE_TRUNCDATE_TRUNC('field', source)Truncates a date/time to the specified precision.
TO_DATETO_DATE(str, format)Converts a string to a date.
TO_TIMESTAMPTO_TIMESTAMP(str, format)Converts a string to a timestamp.
TO_CHARTO_CHAR(date, format)Converts a date/time to a formatted string.
AGEAGE(ts2, ts1)Returns the interval between two timestamps.
MAKE_DATEMAKE_DATE(year, month, day)Creates a date from year, month, and day.
MAKE_INTERVALMAKE_INTERVAL([...units])Creates an interval from unit components.
CLOCK_TIMESTAMPCLOCK_TIMESTAMP()Returns the current real-time timestamp.
