Muunna YYYY-MM-DD DD/MM/YYYY-muotoon

2025-01-15 → 15/01/2025

Pikamuunnin

15/01/2025

Miten Muunnetaan YYYY-MM-DD DD/MM/YYYY-muotoon

Muuntaminen YYYY-MM-DD-muodosta DD/MM/YYYY-muotoon sisältää päivämääräkomponenttien uudelleenjärjestelyn:

Muodosta
YYYY-MM-DD
2025-01-15
muotoon
DD/MM/YYYY
15/01/2025
1

Tunnista Osat

YYYY-MM-DD-muodossa: ISO 8601 standard format, ideal for sorting and international use

2

Järjestä Uudelleen

Järjestä uudelleen vastaamaan DD/MM/YYYY-muotoa: Day-Month-Year format commonly used in Europe, Asia, and most of the world

3

Säädä Erotin

Vaihda erotin "-" muotoon "/" tarvittaessa.

Koodiesimerkit

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

Muut Muunnokset

Avaa Täysi Muunnin →

Liittyvät Sivut