Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Time shaping transformation
Time shaping transformation
Public? Class? Demo00 1? {

Public? String? FormatTime (long? Time)

{

Time? =? Time/? 1000;

String? strHour? =? ""? +? (time/3600);

String? strMinute? =? ""? +? Time% 3600/60;

String? strSecond? =? ""? +? Time% 3600% 60;

strHour? =? strHour.length()? & lt? 2"0"? +? strHour:? strHour

strMinute? =? strMinute.length()? & lt? 2"0"? +? strMinute:? strMinute

strSecond? =? strSecond.length()? & lt? 2"0"? +? strSecond:? strSecond

String? strRsult? =? "";

What if? (! strHour.equals("00 "))

{

strRsult? +=? strHour? +? ":";

}

What if? (! strMinute.equals("00 "))

{

strRsult? +=? strMinute? +? ":";

}

strRsult? +=? strSecond

Return? str result;

}

Public? Static electricity Invalid? main(String[]? args)? {

Demo00 1? De? =? New? demo 00 1();

system . out . println(de . format time(60000));

}

} The results are as follows: