PostgreSQL - DATE/TIME Functions and Operators
We had discussed about the Date/Time data types in the chapter Data Types . Now, let us see the Date/Time operators and Functions. The following table lists the behaviors of the basic arithmetic operators − The following is the list of all important Date and Time related functions available. AGE(timestamp, timestamp), AGE(timestamp) Example of the function AGE(timestamp, timestamp) is − testdb =# SELECT AGE ( timestamp '2001-04-10' , timestamp '1957-06-13' ); The above given PostgreSQL statement will produce the following result − age ------------------------- 43 years 9 mons 27 days Example of the function AGE(timestamp) is − testdb =# select age ( timestamp '1957-06-13' ); The above given PostgreSQL statement will produce the following result − age -------------------------- 55 years 10 mons 22 days CURRENT DATE/TIME() PostgreSQL provides a number of functions that return values related to the current date and time. Foll