JAVA获取时间戳

public static String DateTime(){
Date date = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
return df.format(date);
}

原文地址:https://www.cnblogs.com/arrayblog/p/13068883.html