java.sql.Timestamp如何转换为java.util.Date呢?
下文笔者讲述java.sql.Timestamp转java.util.Date的方法分享,如下所示
实现思路: 使用new Date(时间戳)即可实例化一个Date对象 或 借助Calendar对象中的setTimeInMillis方法即可将一个时间戳转换为Calendar对象
date = new Date(timestampValue.getTime)); 或 Calendar start = Calendar.getInstance(); start.setTimeInMillis( timeStampValue.getTime());
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。