/**
* 获取时间戳
* @param
* @return
*/
public static int getSecondTimestamp(){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// HH:mm:ss
//获取当前时间
Date date = new Date(System.currentTimeMillis());
String timestamp = String.valueOf(date.getTime());
int length = timestamp.length();
if (length > 3) {
return Integer.valueOf(timestamp.substring(0,length-3));
} else {
return 0;
}
}
简单获取 时间戳
最新推荐文章于 2025-10-29 18:36:29 发布
2260

被折叠的 条评论
为什么被折叠?



