Date Format Converter

Convert dates between formats — PHP date(), strftime(), MySQL, JavaScript, Python, and custom patterns.

Format Tokens (PHP date() style)

About Date Format Conversion

Different programming languages, databases, and systems use different date format string syntaxes. PHP uses date("Y-m-d H:i:s"), Python uses strftime("%Y-%m-%d %H:%M:%S"), MySQL has DATE_FORMAT(date, '%Y-%m-%d'), and JavaScript doesn't have a built-in printf-style format function. This tool converts a date to multiple formats simultaneously so you can compare them and copy the one you need.

The format token buttons let you quickly build custom format strings by clicking the tokens you need. The custom format input uses PHP-style date() tokens which are the most widely known date formatting syntax, making it intuitive for developers from any background.

FAQ

What format should I use to store dates in MySQL?
For DATE columns: YYYY-MM-DD (e.g., 2024-01-15). For DATETIME/TIMESTAMP columns: YYYY-MM-DD HH:MM:SS (e.g., 2024-01-15 10:30:00). Always store dates in UTC and convert to local time when displaying. Use ISO 8601 format for JSON API responses.
What is the format token for a full month name?
In PHP date() style: F = full month name (January, February, ...), M = 3-letter abbreviation (Jan, Feb, ...). In Python strftime: %B = full name, %b = abbreviation. In JavaScript Intl: {month: 'long'} or {month: 'short'}.