from datetime import datetime
from babel.dates import format_date
now = datetime.now()
print(format_date(now, format="full", locale="fr_FR"))
now = datetime.now()
locale = "fr_FR" # French
print("--- Using Babel (French) ---")
print("Short date :", format_date(now, format="short", locale=locale))
print("Long date :", format_date(now, format="full", locale=locale))
print("Time :", format_time(now, format="medium", locale=locale))
print("Weekday :", format_datetime(now, "EEEE", locale=locale))
print("Month name :", format_datetime(now, "MMMM", locale=locale))
'''
run:
dimanche 19 avril 2026
--- Using Babel (French) ---
Short date : 19/04/2026
Long date : dimanche 19 avril 2026
Time : 13:02:24
Weekday : dimanche
Month name : avril
'''