🐍
Python DD/MM/YYYY
출력: 15/01/2025
빠른 참조
형식 문자열
%d/%m/%Y
출력
15/01/2025
Python에서 DD/MM/YYYY 형식으로 날짜 포맷
🐍 Python
from datetime import datetime
date = datetime.now()
formatted = date.strftime('%d/%m/%Y')
print(formatted) # Output: 31/12/2025날짜 문자열 파싱
🐍 Python (파싱)
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:00Python 날짜 형식 코드
| 코드 | 의미 | 예시 |
|---|---|---|
| %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 |
Python의 다른 형식
다른 언어의 DD/MM/YYYY
공식 문서
Python의 날짜 형식에 대한 자세한 내용은 공식 문서를 참조하세요: