zhitong.yu
2024-04-18 a239a844f00b4a75c7f22db8a834fc8b5f92b54f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.hxzk.util;
 
import java.text.SimpleDateFormat;
import java.util.Date;
 
public class GetTime {
    public static String getTime(){
        Date date = new Date();
 
        // 定义日期格式化对象
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
        // 格式化日期
        String formattedDate = dateFormat.format(date);
 
        return formattedDate;
    }
}