YYYY-MM in DD/MM/YYYY konvertieren
2025-01 → 15/01/2025
Schnellkonverter
→
15/01/2025
So konvertieren Sie YYYY-MM in DD/MM/YYYY
Bei der Konvertierung von YYYY-MM in DD/MM/YYYY werden die Datumsbestandteile neu angeordnet:
Von
YYYY-MM
2025-01
zu
DD/MM/YYYY
15/01/2025
1
Teile identifizieren
In YYYY-MM: Year-month format following ISO 8601, ideal for file naming and sorting
2
Neu anordnen
Neu anordnen, um dem DD/MM/YYYY-Format zu entsprechen: Day-Month-Year format commonly used in Europe, Asia, and most of the world
3
Trennzeichen anpassen
Ändern Sie das Trennzeichen von "-" zu "/", falls erforderlich.
Codebeispiele
JavaScript
// YYYY-MM in DD/MM/YYYY konvertieren
function convertDate(dateStr) {
// YYYY-MM parsen
const parts = dateStr.split('-');
const [year, month, day] = parts;
// Als DD/MM/YYYY formatieren
return `${day}/${month}/${year}`;
}
console.log(convertDate('2025-01')); // 15/01/2025
Python
from datetime import datetime
# YYYY-MM in DD/MM/YYYY konvertieren
date_str = '2025-01'
date = datetime.strptime(date_str, '%Y-%m-%d')
result = date.strftime('%d/%m/%Y')
print(result) # 15/01/2025