Today is nothing to do, want to find a calculation of tribal conflict building upgrade time. Found no handy, wrote a console output of a small program.
ImportJava.text.SimpleDateFormat;Importjava.util.Date;ImportJava.util.Scanner; Public classT5 { Public Static voidMain (string[] args) {
Gets the current system millisecond Date nowdate=NewDate (System.currenttimemillis ());
Enter building duration System.out.println ("Please enter the time and minute, format is Hh:mm:ss"); Scanner input=NewScanner (system.in); String s=Input.next (); intIndex1=s.indexof (":"); intIndex2=s.indexof (":", index1+1); intHh=integer.parseint (s.substring (0, index1)); intMi=integer.parseint (S.substring (index1+1, Index2)); intSs=integer.parseint (S.substring (index2+1)); intzong=hh*3600+mi*60+SS; Longzhihou= nowdate.gettime () +zong*1000; SimpleDateFormat format=NewSimpleDateFormat ("Yyyy-mm-dd HH:mm:ss");
Get Date System.out.println (HH+ "Hours" +mi+ "min" +ss+ "seconds after" +format.format "(NewDate (Zhihou)); }}
Printing results:
Please enter the time and seconds, in the format hh:mm:ss12:30:0012 hours 30 minutes 0 seconds after: 2016-01-19 06:14:1
Later I will try to write an interface ...
Tools for calculating tribal conflict duration