In PostgreSQL you can use the extract() function to get the day from a date.
You can also use date_part() to do the same thing.
When extracting the day from a date, you need to specify what sense of the word “day” you mean. For example, “day of week”, “day of month”, “day of year”, etc.