Changeset 5b85d19 for util.c


Ignore:
Timestamp:
Jul 3, 2003, 10:46:22 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
9ceee9d
Parents:
de03334
Message:
Idle time reported in minutes, not seconds
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    rde03334 r5b85d19  
    281281
    282282/* caller must free the return */
    283 char *owl_util_seconds_to_timestr(int seconds)
     283char *owl_util_minutes_to_timestr(int in)
    284284{
    285285  int days, minutes, hours;
     
    287287  char *out;
    288288
    289   run=seconds;
    290 
    291   days=run/86400;
    292   run-=days*86400;
    293   hours=run/3600;
    294   run-=hours*3600;
    295   minutes=run/60;
    296   run-=minutes*60;
     289  run=in;
     290
     291  days=run/1440;
     292  run-=days*1440;
     293  hours=run/60;
     294  run-=hours*60;
    297295
    298296  if (days>0) {
    299     out=owl_sprintf("%i d %2.2i:%2.2i:%2.2li", days, hours, minutes, run);
     297    out=owl_sprintf("%i d %2.2i:%2.2i", days, hours, run);
    300298  } else {
    301     out=owl_sprintf("     %2.2i:%2.2i:%2.2li", hours, minutes, run);
     299    out=owl_sprintf("     %2.2i:%2.2i", hours, run);
    302300  }
    303301  return(out);
Note: See TracChangeset for help on using the changeset viewer.