IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2006, 1:39:43 PM (20 years ago)
Author:
eugene
Message:

fixed up the trange concepts, fixed bugs in queuedrop/queuepop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/convert.c

    r4810 r8192  
    116116}
    117117
     118/***** convert seconds to HH:MM:SS ****/
     119char *sec_to_hms (time_t second) {
     120 
     121  struct tm *gmt;
     122  char *line;
     123
     124  ALLOCATE (line, char, 64);
     125  gmt   = gmtime (&second);
     126  sprintf (line, "%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     127  return (line);
     128}
     129
     130/***** convert seconds to Day@HH:MM:SS ****/
     131char *sec_to_day (time_t second) {
     132 
     133  struct tm *gmt;
     134  char *line;
     135
     136  ALLOCATE (line, char, 64);
     137  gmt   = gmtime (&second);
     138  switch (gmt[0].tm_wday) {
     139    case 0:
     140      sprintf (line, "Sun@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     141      break;
     142    case 1:
     143      sprintf (line, "Mon@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     144      break;
     145    case 2:
     146      sprintf (line, "Tue@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     147      break;
     148    case 3:
     149      sprintf (line, "Wed@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     150      break;
     151    case 4:
     152      sprintf (line, "Thu@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     153      break;
     154    case 5:
     155      sprintf (line, "Fri@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     156      break;
     157    case 6:
     158      sprintf (line, "Sat@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec);
     159      break;
     160  }
     161  return (line);
     162}
     163
    118164int hh_hm (double hh, int *hr, double *mn) {
    119165
Note: See TracChangeset for help on using the changeset viewer.