What do you mean by compare? Are you looking for which is earlier/later? If so, the Calendar class has before and after methods. Or do you mean find out how much the time difference is? In which case, these two times are just ultimately a long representing a number of milliseconds. You could subtract one from the other.