PostgreSQLDate/Time FunctionsAGE
TO_CHAR

AGEDate/Time Functions

MAKE_DATE

Returns the interval between two timestamps.

Syntax

AGE(ts2, ts1)

Example

Enter values below to update the example in real time.

employee_id
hire_date
tenure
employees
-- 직원 근속 기간
SELECT employee_id, AGE(CURRENT_DATE, hire_date) AS tenure
FROM employees;