java时间转换
来源:互联网 发布:锐捷冒充mac地址上网 编辑:程序博客网 时间:2024/06/07 00:58
@Test
public void test1(){
Date today=new java.util.Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy/MM/dd");
SimpleDateFormat dateFormat2 = new SimpleDateFormat("yy-MM-dd");
SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("Today is "+dateFormat.format(today));
System.out.println("Today is "+dateFormat1.format(today));
System.out.println("Today is "+dateFormat2.format(today));
System.out.println("Now is "+dateTimeFormat.format(today));
}
public void test1(){
Date today=new java.util.Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy/MM/dd");
SimpleDateFormat dateFormat2 = new SimpleDateFormat("yy-MM-dd");
SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("Today is "+dateFormat.format(today));
System.out.println("Today is "+dateFormat1.format(today));
System.out.println("Today is "+dateFormat2.format(today));
System.out.println("Now is "+dateTimeFormat.format(today));
}
================================================
Today is 2017-09-22
Today is 2017/09/22
Today is 17-09-22
Now is 2017-09-22 16:26:19
阅读全文
0 0
- Java时间转换问题
- Java时间格式转换
- java时间类型转换
- Java 中时间转换
- java时间转换函数
- Java中的时间转换
- JAVA 时间格式转换
- JAVA时间格式转换
- java时间转换
- java时间转换
- java 时间格式转换
- java 时间转换
- java时间类型转换
- Java 日期时间转换
- Java时间格式转换
- java oracle 时间转换
- java ---- php时间转换
- java时间类型转换
- philosophy: the thinking of coding,and mood essay
- ArrayList、LinkedList、Vector的区别
- 获取一个view的具体宽高
- QT 文件夹操作(最精简的文件遍历操作)
- form提交表单中包含time类型数据
- java时间转换
- 关于警笛你不知道的事
- zmq 多路复用poll无法收包的问题(朴素的比对法解决问题)
- RoomScene模块重构前的思考
- Springboot下swagger-ui.html访问不到
- fildReader接口的示例应用
- Leetcode之Next Permutation 问题
- bootstraptable点击行事件
- CentOS 7 下不同主机间 ssh 免密码登录