Last active
July 11, 2019 09:18
-
-
Save git-santosh/f982bc03b148fd77b1c56c4adb204931 to your computer and use it in GitHub Desktop.
How to calculate date and time difference in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre[class*=language-] { | |
padding: 1rem 0 1rem 1rem!important; | |
margin-top: 0; | |
margin-bottom: 1rem; | |
border: 1px solid #d1d1e8; | |
background-color: #f7f7f9; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1. Manual time calculation
Converts
Date
in milliseconds (ms) and calculate the differences between two dates, with following rules :package com.mkyong.date;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateDifferentExample {
}