标签:mil lis bsp 时间戳 uid form random public time
/**
* 32位去除‘-‘的UUID
*/
public static String getUUID() {
String uuid = java.util.UUID.randomUUID().toString();
uuid = uuid.replace("-", "");
return uuid;
}
/**
* 获取现在时间
*
* @return 返回时间类型yyyyMMddHHmmssSSS
*/
public static String getNowDate() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmssSSS");
String dateString = formatter.format(currentTime);
return dateString;
}
// 获取当前系统时间——UUID
public static String getCurTimeUUID() {
return getCurTime("yyyyMMddHHmmssSSS");
}
// 指定格式获取当前系统时间
public static String getCurTime(String formatStr) {
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat dateFormat = new SimpleDateFormat(formatStr);
String curString = dateFormat.format(date);
return curString;
}
标签:mil lis bsp 时间戳 uid form random public time
原文地址:https://www.cnblogs.com/sung1024/p/11210730.html