🐘

PostgreSQL Date Format YYYY-MM-DD

Output: 2025-01-15
Quick Reference
Format String
YYYY-MM-DD
Output
2025-01-15

Format Date as YYYY-MM-DD in PostgreSQL

🐘 PostgreSQL
SELECT TO_CHAR(NOW(), 'YYYY-MM-DD') AS formatted_date; -- Output: 2025-12-31

PostgreSQL Date Format Codes

Code Meaning Example
DD Day of month (01-31) 31
MM Month (01-12) 12
YYYY Year (4 digits) 2025
YY Year (2 digits) 25
Mon Abbreviated month Dec
Month Full month name December

Other Formats in PostgreSQL

YYYY-MM-DD in Other Languages

Official Documentation

For more information about date formatting in PostgreSQL, see the official documentation:

PostgreSQL Date Documentation →

Related Pages