码迷,mamicode.com
首页 > 编程语言 > 详细

Java创建Timestamp的几种方式

时间:2017-08-10 23:37:45      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:amp   current   方式   创建   mil   bsp   nbsp   date   end   

1、java创建Timestamp的几种方式

Timestamp time1 = new Timestamp(System.currentTimeMillis());  
  
Timestamp time2 = new Timestamp(new Date().getTime());  
  
Timestamp time3 = new Timestamp(Calendar.getInstance().getTimeInMillis());  
  
//不建议使用  
Timestamp time4 = new Timestamp(2011-1900,11,11,11,11,11,0); 

 

Java创建Timestamp的几种方式

标签:amp   current   方式   创建   mil   bsp   nbsp   date   end   

原文地址:http://www.cnblogs.com/areyouready/p/7341862.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!