最简单的时间格式类

80酷酷网    80kuku.com

  /*
file: timeformat.java
*/

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());  
  }
}



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: