我通过我的下面的java代码将日期值插入到名为Source
的表的列中。
Date today = new Date();
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
String todayDate = df.format(today).toString();
myVO.setMyDate(todayDate);
myDao.saveOrUpdateVO(myVO);
稍后,我正在检索存储在Source
表列中的日期值,并将该日期插入destination
表。
现在,我注意到Source
表中存储的日期值如下所示,
18-Oct-2015 00:00:0
destination
表中存储的值为 - 18-Oct-2015 08:15:0
。
为什么会有这种差异?如果我想将日期值存储在Source
表中,就像它存储在destination
中一样,我需要做什么?
两个表中列的数据类型为date default sysdate