Java创建Timestamp的几种方式

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

 

posted on 2017-08-10 22:42    阅读(49263)  评论(0编辑  收藏  举报