YYYY-MM DD/MM/YYYY ට පරිවර්තනය
2025-01 → 15/01/2025
ඉක්මන් පරිවර්තකය
→
15/01/2025
YYYY-MM DD/MM/YYYY ට පරිවර්තනය කරන්නේ කෙසේද
YYYY-MM සිට DD/MM/YYYY ට පරිවර්තනයේදී දින කොටස් නැවත සකස් කිරීම ඇතුළත් වේ:
සිට
YYYY-MM
2025-01
ට
DD/MM/YYYY
15/01/2025
1
කොටස් හඳුනාගන්න
YYYY-MM හි: Year-month format following ISO 8601, ideal for file naming and sorting
2
නැවත සකස් කරන්න
DD/MM/YYYY ආකෘතියට ගැළපෙන ලෙස නැවත සකස් කරන්න: Day-Month-Year format commonly used in Europe, Asia, and most of the world
3
වෙන්කරන්නා සකසන්න
අවශ්ය නම් වෙන්කරන්නා "-" සිට "/" ට වෙනස් කරන්න.
කේත උදාහරණ
JavaScript
// YYYY-MM DD/MM/YYYY ට පරිවර්තනය
function convertDate(dateStr) {
// YYYY-MM විග්රහ කරන්න
const parts = dateStr.split('-');
const [year, month, day] = parts;
// DD/MM/YYYY ලෙස ආකෘතිගත කරන්න
return `${day}/${month}/${year}`;
}
console.log(convertDate('2025-01')); // 15/01/2025
Python
from datetime import datetime
# YYYY-MM DD/MM/YYYY ට පරිවර්තනය
date_str = '2025-01'
date = datetime.strptime(date_str, '%Y-%m-%d')
result = date.strftime('%d/%m/%Y')
print(result) # 15/01/2025