🐘
PHP Date Format YYYY-MM-DD
Output: 2025-01-15
Quick Reference
Format String
Y-m-d
Output
2025-01-15
Format Date as YYYY-MM-DD in PHP
🐘 PHP
<?php
echo date('Y-m-d'); // Output: 2025-12-31PHP Date Format Codes
| Code | Meaning | Example |
|---|---|---|
| d | Day (01-31) | 31 |
| j | Day (1-31) | 31 |
| m | Month (01-12) | 12 |
| n | Month (1-12) | 12 |
| Y | Year (4 digits) | 2025 |
| y | Year (2 digits) | 25 |
| M | Abbreviated month | Dec |
| F | Full month | December |
Other Formats in PHP
YYYY-MM-DD in Other Languages
Official Documentation
For more information about date formatting in PHP, see the official documentation: