Converts the number of milliseconds or two date types to * day * hour * minute * second, which is often used for time period calculation.
/** <Br/> * @ Param the number of milliseconds to be converted <br/> * @ return the number of milliseconds to be converted to * Days * hours * minutes * seconds format <br/> * @ author FY. zhang <br/> */<br/> Public static string formatduring (long MSS) {<br/> long days = MSS/(1000*60*60*24 ); <br/> long hours = (MSS % (1000*60*60*24)/(1000*60*60 ); <br/> long minutes = (MSS % (1000*60*60)/(1000*60 ); <br/> long seconds = (MSS % (1000*60)/1000; <br/> return days + "days" + hours + "hours" + minutes + "Minutes" <br/> + seconds + "seconds "; <br/>}< br/>/** <br/> * @ Param begin start time period <br/> * @ Param end time period <br/> * @ return: the time difference between two date data types is displayed in the format of * Days * hours * minutes * seconds <br/> * @ author FY. zhang <br/> */<br/> Public static string formatduring (date begin, date end) {<br/> return formatduring (end. gettime ()-begin. gettime (); <br/>}< br/>
Hope you can use it.