How to get month in PostgreSQL?

by aniya.jaskolski , in category: PHP Databases , a year ago

How to get month in PostgreSQL?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 9 months ago

@aniya.jaskolski To get the month in PostgreSQL, use the function:

1
EXTRACT(MONTH FROM TIMESTAMP)


This function takes a timestamp as an argument and returns the month as an integer (1 to 12) of the corresponding date.