🐍

Python DD/MM/YYYY

Sortie: 15/01/2025
Reference Rapide
Chaine de Format
%d/%m/%Y
Sortie
15/01/2025

Formater la date en DD/MM/YYYY avec Python

🐍 Python
from datetime import datetime date = datetime.now() formatted = date.strftime('%d/%m/%Y') print(formatted) # Output: 31/12/2025

Analyser une chaine de date

🐍 Python (Analyse)
from datetime import datetime date_string = '31/12/2025' date = datetime.strptime(date_string, '%d/%m/%Y') print(date) # Output: 2025-12-31 00:00:00

Codes de format de date Python

Code Signification Exemple
%d Day of month (01-31) 31
%m Month (01-12) 12
%Y Year with century 2025
%y Year without century (00-99) 25
%b Abbreviated month name Dec
%B Full month name December
%a Abbreviated weekday Wed
%A Full weekday name Wednesday

Autres formats en Python

DD/MM/YYYY dans autres langages

Documentation Officielle

Pour plus informations sur le formatage des dates en Python, consultez la documentation officielle :

Documentation des dates Python →

Pages Associees