杨凯
2023-10-17 e7c9fc40786f387f2c0d65e10294317480b0f621
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.consum.base.core.util;
 
import com.walker.infrastructure.utils.DateUtils;
 
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
 
public class DateUtil extends DateUtils {
 
 
    public static void main(String[] args) {
        System.out.println(DateUtil.getCurrentDateFor14());
    }
 
    /**
     * 返回14位年月日时分秒 20230912081256
     * @return
     */
    public static Long getCurrentDateFor14(){
        Date date = new Date();
        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyyMMddHHmmss");
        return Long.valueOf(dateFormat.format(date));
    }
}