Skip to content

Instantly share code, notes, and snippets.

@HennIdan
Created July 12, 2016 14:33
Show Gist options
  • Save HennIdan/7ffb627fbbaf45b927276716ceacb99e to your computer and use it in GitHub Desktop.
Save HennIdan/7ffb627fbbaf45b927276716ceacb99e to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws ParseException {
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String str3 = "1927-12-31 23:54:07";
String str4 = "1927-12-31 23:54:08";
Date sDt3 = sf.parse(str3);
Date sDt4 = sf.parse(str4);
long ld3 = sDt3.getTime() /1000;
long ld4 = sDt4.getTime() /1000;
System.out.println(ld4-ld3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment