标签:书籍 targe sim format date() www bsp system util
import java.util.*;
import java.text.SimpleDateFormat;
public class Test {
public static void main(String[] args) {
Date date = new Date();//获取当前日期
SimpleDateFormat df = new SimpleDateFormat("yyyy-MMM-dd kk:mm:ss a");
System.out.println(df.format(date));//按yyyy-MMM-dd kk:mm:ss a这个格式来格式化date
SimpleDateFormat df1 = new SimpleDateFormat(
"yyyyy.MMMMM.dd GGG hh:mm aaa");
。。。。。。。。。。。。。。。。。。
详情请见:http://www.mark-to-win.com/index.html?content=JavaBeginner/javaUrl.html&chapter=JavaBeginner/JavaBeginner2_web.html#FormatTime
标签:书籍 targe sim format date() www bsp system util
原文地址:https://www.cnblogs.com/mark-to-win/p/9692095.html