/**
* 打印当前时间
*
* @return
*/
public static void printCurrentTime(String param) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 关键所在
TimeZone gmt = TimeZone.getTimeZone("GMT+8");
sdf.setTimeZone(gmt);
sdf.setLenient(true);
System.out.println(sdf.format(new Date()) + ":" + param);
}
posted on 2023-04-27 11:05  田坤坤  阅读(86)  评论(0编辑  收藏  举报