@Test
void contextLoads() {
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-mm-dd");
Date start = null;
Date end = null;
try {
start = simpleDateFormat.parse("2020-04-06");
end = simpleDateFormat.parse("2020-12-01");
}catch (Exception e){
e.printStackTrace();
}
System.out.println(start+" "+end);
UserExample userExample=new UserExample();
UserExample.Criteria criteria=userExample.createCriteria();
criteria.andRegisterTimeGreaterThanOrEqualTo(start);
criteria.andRegisterTimeLessThanOrEqualTo(end);
List<User> userList=userMapper.selectByExample(userExample);
结果发现传入的参数被重置
连接mysql也写了时区
请问一下这可能会是什么原因?