Java格式化时间yyyy-MM-dd HH:mm:ss
Java格式化时间
yyyy-MM-dd HH:mm:ss
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateFormat {
public String Date() {
Date time = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String timeFormat = sdf.format(time);
return timeFormat;
}
}
本文来自博客园,作者:AnNing21,转载请注明原文链接:https://www.cnblogs.com/AnNing21/p/14313842.html