本文参考:http://djw2007.cool.blog.163.com/blog/static/4388109420128753118445/
方法1:
Timestamp time1 = new Timestamp(System.currentTimeMillis());
System.out.println(time1);
方法2:
Date date = new Date();
Timestamp time2 = new Timestamp(date.getTime());
System.out.println(time2);