🐬

MySQL YYYY-MM-DD

Output: 2025-01-15
Riferimento Rapido
Stringa Formato
%Y-%m-%d
Output
2025-01-15

Formattare data come YYYY-MM-DD in MySQL

🐬 MySQL
SELECT DATE_FORMAT(NOW(), '%Y-%m-%d') AS formatted_date; -- Output: 2025-12-31

Parsare stringa data

🐬 MySQL (Parsing)
SELECT STR_TO_DATE('2025-12-31', '%Y-%m-%d') AS parsed_date; -- Output: 2025-12-31

Codici formato data MySQL

Codice Significato Esempio
%d Day of month (01-31) 31
%e Day of month (1-31) 31
%m Month (01-12) 12
%c Month (1-12) 12
%Y Year (4 digits) 2025
%y Year (2 digits) 25
%b Abbreviated month Dec
%M Full month name December

Altri formati in MySQL

YYYY-MM-DD in altri linguaggi

Documentazione Ufficiale

Per maggiori informazioni sulla formattazione date in MySQL, consulta la documentazione ufficiale:

Documentazione date MySQL →

Pagine Correlate