Day Of Week By Name For A Date
Last updated
Was this helpful?
Last updated
Was this helpful?
In , I explained how to determine what day of the week a date is as an integer with PostgreSQL. This used the date_part()
function. By using the to_char()
function with a date or timestamp, we can determine the day of the week by name (e.g. Monday). For instance, to determine what day today is, try a statement like the following:
The Day
part of the second argument is just one of many template patterns that can be used for formatting dates and times.
See in the Postgres docs for more details.