集册 Java实例教程 将日期转换为毫秒

将日期转换为毫秒

欢马劈雪     最近更新时间:2020-01-02 10:19:05

406
将日期转换为毫秒


import java.util.*;

 /** 来 自 时   代     Java  公  众  号 - nowjava.com**/

public class Main {

 

  public static void main(String args[]){

      Date date = new Date();

      System.out.println("Date is : " + date);

     

      //use getTime() method to retrieve milliseconds

      System.out.println("Milliseconds since January 1, 1970, 00:00:00 GMT : "

                          + date.getTime());

   

  }
  /*
  来 自*
   n o w    j a v a  . c o m
  */

 

}