DD/MM/YYYY ஐ YYYY-MM-DD க்கு மாற்றவும்
15/01/2025 → 2025-01-15
விரைவு மாற்றி
→
2025-01-15
DD/MM/YYYY ஐ YYYY-MM-DD க்கு எவ்வாறு மாற்றுவது
DD/MM/YYYY இலிருந்து YYYY-MM-DD க்கு மாற்றுவது தேதி கூறுகளை மறுசீரமைப்பதை உள்ளடக்கியது:
இருந்து
DD/MM/YYYY
15/01/2025
க்கு
YYYY-MM-DD
2025-01-15
1
பகுதிகளை அடையாளம் காணவும்
DD/MM/YYYY இல்: Day-Month-Year format commonly used in Europe, Asia, and most of the world
2
மறுசீரமைக்கவும்
YYYY-MM-DD வடிவத்திற்கு பொருந்த மறுசீரமைக்கவும்: ISO 8601 standard format, ideal for sorting and international use
3
பிரிப்பானை சரிசெய்யவும்
தேவைப்பட்டால் பிரிப்பானை "/" இலிருந்து "-" க்கு மாற்றவும்.
குறியீட்டு எடுத்துக்காட்டுகள்
JavaScript
// DD/MM/YYYY ஐ YYYY-MM-DD க்கு மாற்றவும்
function convertDate(dateStr) {
// DD/MM/YYYY ஐ பகுப்பாய்வு செய்யவும்
const parts = dateStr.split('/');
const [day, month, year] = parts;
// YYYY-MM-DD ஆக வடிவமைக்கவும்
return `${year}-${month}-${day}`;
}
console.log(convertDate('15/01/2025')); // 2025-01-15
Python
from datetime import datetime
# DD/MM/YYYY ஐ YYYY-MM-DD க்கு மாற்றவும்
date_str = '15/01/2025'
date = datetime.strptime(date_str, '%d/%m/%Y')
result = date.strftime('%Y-%m-%d')
print(result) # 2025-01-15