🐍
Python MM/DD/YYYY
Ieșire: 01/15/2025
Referință Rapidă
Șir de Format
%m/%d/%Y
Ieșire
01/15/2025
Formatarea datei ca MM/DD/YYYY în Python
🐍 Python
from datetime import datetime
date = datetime.now()
formatted = date.strftime('%m/%d/%Y')
print(formatted) # Output: 12/31/2025Coduri de format dată Python
| Cod | Semnificație | Exemplu |
|---|---|---|
| %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 |
Alte formate în Python
MM/DD/YYYY în alte limbaje
Documentație Oficială
Pentru mai multe informații despre formatarea datelor în Python, vezi documentația oficială: