postgresql

How to implement add_months in PostgreSQL?


How to implement add_months in PostgreSQL ?? Like oracle ADD_MONTHS returns the date. Ex. ADD_MONTHS(hire_date,1)


Solution

  • use

     hire_date + interval '1 month'
    

    this will return exactly one month added to hire_date.

    For More References on date and time functions in postgre Date time function