JAVA 获取当前日期:字符串类型

// 获取现在
public static String getLNowStr() {
Date currentTime = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
String dateStr = simpleDateFormat.format(currentTime);
return dateStr;
}

猜你喜欢

转载自blog.csdn.net/weixin_46075394/article/details/114668149