zhitong.yu
2024-03-15 ebd89b9ffa8980ac944a7e79ecc64c01637d4f17
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;
    }
}