package com.cim.idm.utils;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class TimeKey {

    private static final String FORMAT_TIMEKEY="yyyyMMddHHmmssSSSSSS";
    // 获取当前时间
    public static String getNowTime(){
        Date date = new Date();
        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :HH:mm:ss");
        String format = dateFormat.format(date);
        return format.replaceAll("-","")
                .replaceAll(":","").replaceAll(" ","");
    }

    public static String getSeqId(){
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern(FORMAT_TIMEKEY));
    }

}
