🐍

Python YYYY-MM-DD

출력: 2025-01-15
빠른 참조
형식 문자열
%Y-%m-%d
출력
2025-01-15

Python에서 YYYY-MM-DD 형식으로 날짜 포맷

🐍 Python
from datetime import datetime date = datetime.now() formatted = date.strftime('%Y-%m-%d') print(formatted) # Output: 2025-12-31

날짜 문자열 파싱

🐍 Python (파싱)
from datetime import datetime date_string = '2025-12-31' date = datetime.strptime(date_string, '%Y-%m-%d') print(date) # Output: 2025-12-31 00:00:00

Python 날짜 형식 코드

코드 의미 예시
%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의 다른 형식

다른 언어의 YYYY-MM-DD

공식 문서

Python의 날짜 형식에 대한 자세한 내용은 공식 문서를 참조하세요:

Python 날짜 문서 →

관련 페이지