function common:second2datestring (second, withsecond) local
HMS = Split (Fxgamemaths:formatsecondstotime (second) , ":") local
datestr = "" "Local
H = tonumber (hms[1])
if h > 0 then
if h >=-then local
d = Mat H.floor (h/24)
datestr = d. Fxlanguage:getinstance (): GetString ("@Days")
end
datestr = Datestr. (h% 24). Fxlanguage:getinstance (): GetString ("@Hour") end local
m = Tonumber (hms[2))
if h > 0 or M > 0 then
datestr = Datestr. M.. Fxlanguage:getinstance (): GetString ("@Minute")
end
if Withsecond = = Nil or Withsecond = = TRUE or Datestr = "" th En local
s = Tonumber (hms[3])
datestr = Datestr. S.. Fxlanguage:getinstance (): GetString ("@Second") End return
datestr
End
Second, time is seconds, Withsecond
Local TIMESTR = Common:second2datestring (Thisactivityinfo.remaintime, false);--Conversion to time function--seconds to date
/** * Conversion times * @param time (seconds) * @param type 0 (time minutes) 1 (06:59:59) * @param nosec whether with seconds */Static ConvertTime (time:number, type:number = 1, Nosec:boolean = False): string {var day:nu
Mber = Math.floor (time/86400);
var $day: number = day * 86400;
var hour:number = Math.floor ((time-$day)/3600);
var $hour: number = hour * 3600;
var min:number = Math.floor (time-$day-$hour)/60);
var $min: number = min * 60;
var sen:number = Math.Round (time-$day-$hour-$min);//rounded integer var str:string = ""; if (type = = 0) {if (Day > 0) {str = day.tostring () + LangManager.instance.getTex
T ("@Day");
} if (Hour > 0) {str + = hour.tostring () + LangManager.instance.getText ("@Hour");
} if (min > 0) { STR + + min.tostring () + LangManager.instance.getText ("@Minute"); } if (Sen > 0 &&!nosec) {str + + sen.tostring () + LangManager.instance.get
Text ("@Second");
} else if (type = = 1) {Hour + = day * 24;
if (Hour > 0) {if (hour <) {str = "0";
STR + + hour.tostring () + ":";
else {str = "00:";
} if (min > 0) {if (min <) {str = "0";
STR + + min.tostring () + ":";
else {str = "00:"; } if (Sen > 0 &&!nosec) {if (Sen <) {str +
= "0"; STR + + sen.tostring ();
else {str = "00";
} return str; }