DaTeText2

import java.text.ParseException;
import java.util.Date;
public class Text2 {
 public static void main(String[] args) throws ParseException {
  Date d = new Date();
  String s = DateDemo1.dateToString(d, "h:mm a");
  System.out.println(s);
  String ss=DateDemo1.dateToString(d, "yyyy.MM.dd G 'at' HH:mm:ss z" );
  System.out.println(ss);
  
     String str ="2018.10.27";
     Date d2=DateDemo1.stringToDate(str, "yyyy.MM.dd");
     System.out.println(d2);
 }
}
posted @ 2018-11-01 09:31  阿蓉  阅读(141)  评论(0编辑  收藏  举报