device代码添加字段
This commit is contained in:
@@ -92,6 +92,24 @@ public class PubUtils {
|
||||
return bf.format(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 毫秒转时间 ms:需要转换的毫秒时间
|
||||
*/
|
||||
public static Date ms2Date(Long ms) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTimeInMillis(ms);
|
||||
return c.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期转字符串函数 date:需要转换的日期 strFormat:转换的格式(yyyy-MM-dd HH:mm:ss)
|
||||
*/
|
||||
public static String date2String(Date date, String strFormat){
|
||||
SimpleDateFormat format = new SimpleDateFormat(strFormat);
|
||||
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前web的IP
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user