将日期转换为毫秒
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 */ }