Konwertuj DD/MM/YYYY do MM/YYYY

15/01/2025 → 01/2025

Szybki Konwerter

01/2025

Jak Przekonwertować DD/MM/YYYY do MM/YYYY

Konwersja z DD/MM/YYYY do MM/YYYY polega na przestawieniu składników daty:

Z
DD/MM/YYYY
15/01/2025
do
MM/YYYY
01/2025
1

Zidentyfikuj Części

W DD/MM/YYYY: Day-Month-Year format commonly used in Europe, Asia, and most of the world

2

Przestaw

Przestaw, aby dopasować do formatu MM/YYYY: Month-year format commonly used for credit cards, expiration dates, and monthly reports

3

Dostosuj Separator

Zmień separator z "/" na "/" jeśli to konieczne.

Przykłady Kodu

JavaScript
// Konwertuj DD/MM/YYYY do MM/YYYY function convertDate(dateStr) { // Parsuj DD/MM/YYYY const parts = dateStr.split('/'); const [day, month, year] = parts; // Formatuj jako MM/YYYY return `${year}-${month}-${day}`; } console.log(convertDate('15/01/2025')); // 01/2025
Python
from datetime import datetime # Konwertuj DD/MM/YYYY do MM/YYYY date_str = '15/01/2025' date = datetime.strptime(date_str, '%d/%m/%Y') result = date.strftime('%Y-%m-%d') print(result) # 01/2025

Inne Konwersje

Otwórz Pełny Konwerter →

Powiązane Strony