用Timestamp就行了
recordOuttime是Date类型
import java.sql.Timestamp;
Record record = recordMapper.selectByPrimaryKey(recordId);
Date recordIntime = record.getRecordIntime();
Date dNow = new Date();
Timestamp recordOuttime = new Timestamp(dNow.getTime());
record.setRecordOuttime(recordOuttime);
本文介绍了如何将Java中的Date类型转换为Timestamp,以适应数据库操作,包括记录Intime的获取、当前时间的获取以及RecordOuttime字段的更新。
2490





