🐍
Python MM/DD/YYYY
Izvade: 01/15/2025
Ātrā atsauce
Formāta virkne
%m/%d/%Y
Izvade
01/15/2025
Formatēt datumu kā MM/DD/YYYY Python
🐍 Python
from datetime import datetime
date = datetime.now()
formatted = date.strftime('%m/%d/%Y')
print(formatted) # Output: 12/31/2025Python datuma formāta kodi
| Kods | Nozīme | Piemērs |
|---|---|---|
| %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 |
Citi formāti Python
MM/DD/YYYY citās valodās
Oficiālā dokumentācija
Lai iegūtu vairāk informācijas par datuma formatēšanu Python, skatiet oficiālo dokumentāciju: