I\'ve run the below java code to get time difference.
import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.
Changing the SimpleDateFormat pattern to yyyy-MM-dd HH:mm:ss fixes the issues.
SimpleDateFormat
yyyy-MM-dd HH:mm:ss
This happens because in the yyyy-MM-dd hh:mm:ss case, 12 is evaluated as 0.
yyyy-MM-dd hh:mm:ss
12
0