最简单的时间格式类

import java.lang.*;
import java.text.*;
import java.util.*;

public class timeformat{

  public timeformat(){
    
  }
 
  static public String getChineseFormatTime(){
 
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
  
      return sdf.format(new Date()); 
  }
 
  static public String getSimpleFormatTime(){
 
      SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm", Locale.US);
  
      return sdf.format(new Date()); 
  }
}

posted @ 2008-11-10 17:27  陆陆通通  阅读(109)  评论(0编辑  收藏  举报