SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
"yyyy-MM-dd HH:mm:ss" // 2023-07-15 14:30:25
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String formattedDate = sdf.format(new Date()); // 输出:2023-07-15
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
"yyyy-MM-dd HH:mm:ss" // 2023-07-15 14:30:25
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String formattedDate = sdf.format(new Date()); // 输出:2023-07-15
文章已关闭评论!