JAVA的Data和Timestamp的相互转换

Data转Timestamp:

Timestamp createTime = new Timestamp(new Date().getTime());

Timestamp 转Data:

    Timestamp t = new Timestamp(System.currentTimeMillis());
    Date d = new Date(t.getTime());

 

posted @ 2020-09-17 14:04  miracle2  阅读(697)  评论(0编辑  收藏  举报