模拟试题

3773考试网计算机等级考试模拟试题正文

JAVA时间格式化处理

来源:fjzsksw.com 2010-11-4 14:01:15

 

 

  JAVA时间格式化处理

  import java.util.Date;

  import java.text.SimpleDateFormat;

  class dayTime

  {

  public static void main(String args[])

  {

  Date nowTime=new Date();

  System.out.println(nowTime);

  SimpleDateFormat time=new SimpleDateFormat("yyyy MM dd HH mm ss");

  System.out.println(time.format(nowTime));

  }

  }

 

 

触屏版 电脑版
3773考试网 琼ICP备12003406号-1