Below is the method I wrote:
public List<Map<String, Object>> loadNotYetInEmployee(int shift, Date date,
int transitionVal, String type, User user) {
DateTime datetime = new DateTime(date);
datetime = datetime
.plus(Period.minutes(shiftTiming.getSession1InTime()));
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
sql = SqlMapUtils.getSql("attendance.attendancestatus.latein",
parameters);
result = getJdbcTemplate().queryForList(sql);
for (int i = 0; i < result.size(); i++) {
Date punchInTime = (Date) result.get(i).get("punchtime");
DateTime punchTime = new DateTime(punchInTime);
}
return result;
}
Now from my method you can see I have a Joda-Time DateTime object in object named datetime
and from my result I am getting one timestamp which I am converting to jodatime punchTime
. Now I want to find out the diff between these two dates, how do I do that?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…