Java创建Timestamp的几种方式

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

 

本文来源huayang183,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/18457

发表评论