122 int tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0;
123 int tmp_years = 0, tmp_weeks = 0, tmp_days = 0;
125 tmp_seconds =
floor(seconds);
129 tmp_minutes =
floor(tmp_seconds / 60);
133 tmp_seconds -= (tmp_minutes * 60);
134 tmp_hours =
floor(tmp_minutes / 60);
138 tmp_minutes -= (tmp_hours * 60);
139 tmp_days =
floor(tmp_hours / 24);
143 tmp_hours -= (tmp_days * 24);
144 tmp_weeks =
floor(tmp_days / 7);
148 tmp_days -= (tmp_weeks * 7);
149 tmp_years =
floor(tmp_weeks / 52);
158 case 1:
return sprintf(
"%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds);
162 #define APPEND_TIME(unit) \
163 if (tmp_##unit) output = strcat(output, ((output != "") ? ", " : ""), count_##unit(tmp_##unit))
181 if (tmp_weeks) tmp_days += (tmp_weeks * 7);
182 if (tmp_years) tmp_days += (tmp_years * 365);
187 ((output !=
"") ?
strcat(
", ", output) :
""));
ERASEABLE string count_fill(float interval, string zeroth, string first, string second, string third, string multi)