📜  日期到字符串 java 代码示例

📅  最后修改于: 2022-03-11 14:52:05.804000             🧑  作者: Mango

代码示例3
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");  
try {  
    Date date = new Date();  
    String dateTime = dateFormat.format(date);
    System.out.println("Current Date Time : " + dateTime); 
} catch (ParseException e) {
    e.printStackTrace();  
}