将MM/DD/YYYY转换为DD/MM/YYYY

01/15/2025 → 15/01/2025

快速转换器

15/01/2025

如何将MM/DD/YYYY转换为DD/MM/YYYY

从MM/DD/YYYY转换到DD/MM/YYYY需要重新排列日期组成部分:

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

识别各部分

在MM/DD/YYYY中: Month-Day-Year format primarily used in the United States

2

重新排列

重新排序以匹配DD/MM/YYYY格式: Day-Month-Year format commonly used in Europe, Asia, and most of the world

3

调整分隔符

如有需要,将分隔符从"/"更改为"/"。

代码示例

JavaScript
// 将MM/DD/YYYY转换为DD/MM/YYYY function convertDate(dateStr) { // 解析MM/DD/YYYY const parts = dateStr.split('/'); const [month, day, year] = parts; // 格式化为DD/MM/YYYY return `${day}/${month}/${year}`; } console.log(convertDate('01/15/2025')); // 15/01/2025
Python
from datetime import datetime # 将MM/DD/YYYY转换为DD/MM/YYYY date_str = '01/15/2025' date = datetime.strptime(date_str, '%m/%d/%Y') result = date.strftime('%d/%m/%Y') print(result) # 15/01/2025

其他转换

打开完整转换器 →

相关页面