最简单的时间格式类
类别: JAVA教程
/*
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());
}
}
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());
}
}
-= 资 源 教 程 =-
文 章 搜 索