If you’re familiar with PostgreSQL, you might know that you can use the EXTRACT()
and the DATE_PART()
functions to extract the month from a date. But those functions only allow you to extract the month number.
What if you need the month name?
You can get the month name from a date by using the TO_CHAR()
function. This function returns a string based on the timestamp and the template pattern you provide as arguments.