MM/YYYY을(를) DD/MM/YYYY(으)로 변환
01/2025 → 15/01/2025
빠른 변환
→
15/01/2025
MM/YYYY을(를) DD/MM/YYYY(으)로 변환하는 방법
MM/YYYY에서 DD/MM/YYYY(으)로의 변환은 날짜 구성 요소를 재배열합니다:
에서
MM/YYYY
01/2025
에서
DD/MM/YYYY
15/01/2025
1
부분 식별
MM/YYYY 형식에서: Month-year format commonly used for credit cards, expiration dates, and monthly reports
2
재배열
DD/MM/YYYY 형식에 맞게 재배열: Day-Month-Year format commonly used in Europe, Asia, and most of the world
3
구분자 조정
필요한 경우 구분자를 "/"에서 "/"(으)로 변경합니다.
코드 예시
JavaScript
// MM/YYYY을(를) DD/MM/YYYY(으)로 변환
function convertDate(dateStr) {
// MM/YYYY 파싱
const parts = dateStr.split('/');
const [year, month, day] = parts;
// DD/MM/YYYY(으)로 포맷
return `${day}/${month}/${year}`;
}
console.log(convertDate('01/2025')); // 15/01/2025
Python
from datetime import datetime
# MM/YYYY을(를) DD/MM/YYYY(으)로 변환
date_str = '01/2025'
date = datetime.strptime(date_str, '%Y-%m-%d')
result = date.strftime('%d/%m/%Y')
print(result) # 15/01/2025