MM/DD/YYYY MM/YYYY ലേക്ക് പരിവർത്തനം
01/15/2025 → 01/2025
ദ്രുത കൺവെർട്ടർ
→
01/2025
MM/DD/YYYY എങ്ങനെ MM/YYYY ലേക്ക് പരിവർത്തനം ചെയ്യാം
MM/DD/YYYY ൽ നിന്ന് MM/YYYY ലേക്ക് പരിവർത്തനം തീയതി ഘടകങ്ങൾ പുനക്രമീകരിക്കൽ ഉൾക്കൊള്ളുന്നു:
നിന്ന്
MM/DD/YYYY
01/15/2025
ലേക്ക്
MM/YYYY
01/2025
1
ഭാഗങ്ങൾ തിരിച്ചറിയുക
MM/DD/YYYY ൽ: Month-Day-Year format primarily used in the United States
2
പുനക്രമീകരിക്കുക
MM/YYYY ഫോർമാറ്റുമായി പൊരുത്തപ്പെടാൻ പുനക്രമീകരിക്കുക: Month-year format commonly used for credit cards, expiration dates, and monthly reports
3
സെപ്പറേറ്റർ ക്രമീകരിക്കുക
ആവശ്യമെങ്കിൽ സെപ്പറേറ്റർ "/" ൽ നിന്ന് "/" ലേക്ക് മാറ്റുക.
കോഡ് ഉദാഹരണങ്ങൾ
JavaScript
// MM/DD/YYYY MM/YYYY ലേക്ക് പരിവർത്തനം
function convertDate(dateStr) {
// MM/DD/YYYY പാഴ്സ് ചെയ്യുക
const parts = dateStr.split('/');
const [month, day, year] = parts;
// MM/YYYY ആയി ഫോർമാറ്റ് ചെയ്യുക
return `${year}-${month}-${day}`;
}
console.log(convertDate('01/15/2025')); // 01/2025
Python
from datetime import datetime
# MM/DD/YYYY MM/YYYY ലേക്ക് പരിവർത്തനം
date_str = '01/15/2025'
date = datetime.strptime(date_str, '%m/%d/%Y')
result = date.strftime('%Y-%m-%d')
print(result) # 01/2025