🐍
Python MM/DD/YYYY
Išvestis: 01/15/2025
Greita nuoroda
Formato eilutė
%m/%d/%Y
Išvestis
01/15/2025
Formatuoti datą kaip MM/DD/YYYY Python
🐍 Python
from datetime import datetime
date = datetime.now()
formatted = date.strftime('%m/%d/%Y')
print(formatted) # Output: 12/31/2025Python datos formato kodai
| Kodas | Reikšmė | Pavyzdys |
|---|---|---|
| %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 |
Kiti formatai Python
MM/DD/YYYY kitose kalbose
Oficiali dokumentacija
Norėdami gauti daugiau informacijos apie datos formatavimą Python, peržiūrėkite oficialią dokumentaciją: