将日期变为指定格式
来源:互联网 发布:mac windows f1 编辑:程序博客网 时间:2024/05/21 16:22
import java.text.SimpleDateFormat;
import java.util.Date;
class DateTime{
private SimpleDateFormat sdf=null;
public String getDate(){
this.sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
return this.sdf.format(new Date());
}
public String getDateComplete(){
this.sdf=new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒SSS毫秒");
return this.sdf.format(new Date());
}
public String getTimeStamp{
this.sdf=new SimpleDateFormat("yyyyMMddHHmmssSSS");
return this.sdf.format(new Date());
}
}
public class DateTest{
public static void main(String[] args){
DateTime dt=new DateTime();
System.out.println("系统时间:"+dt.getDate());
System.out.println("中文日期:"+dt.getDateComplete());
System.out.println("时间戳:"+dt.getTimeStamp());
}
}
- 将日期变为指定格式
- 将日期时间转换为指定格式
- 将日期转换成指定的格式
- 把日期变为- -格式显示
- freemarker将指定日期字符串转换为指定的格式
- Java如何将指定字符串转化为指定日期格式
- Java将Unix时间戳转换成指定格式日期
- Oracle语句将日期值转为指定格式的字符串
- Java将Unix时间戳转换成指定格式日期
- Java将Unix时间戳转换成指定格式日期
- Java将Unix时间戳转换成指定格式日期
- Java将时间戳转换成指定格式日期
- Java将Unix时间戳转换成指定格式日期
- Java将Unix时间戳转换成指定格式日期
- js将毫秒转换成指定格式的日期时间
- 将字符串转换为日期,将日期转换成指定格式的字符串
- 根据指定 日期格式 生成 指定格式的指定日期
- 将未指定格式的日期字符串转化成java.util.Date类型日期对象
- C++ char*,const char*,string的相互转换
- POJ 2488 A Knight's Journey
- absolute 绝对定位水平居中问题
- C++ 编程规范101读书笔记(3)编程风格
- ArcGIS Runtime SDK for iOS开发系列教程(5)——要素信息的绘制
- 将日期变为指定格式
- Nutch环境搭建
- 学习笔记 (Sublime编辑器使用技巧:随时更新) [第八课]
- Ubuntu 12.04安装Hadoop
- Android中关于Volley的使用(二)加载Json数据
- 使用 Ant 打包 Android 应用
- Path Sum
- The APR based Apache Tomcat Native library which allows ...java.library...异常
- afdafsfga