libtime++: Date and time calculation

◆ time_sprint()

char* time_sprint ( time_Ts  Date)

Definition at line 39 of file ctime_sprint.c.

References time_Ts::doy, time_Ts::hour, time_Ts::micsec, time_Ts::milsec, time_Ts::minute, time_Ts::second, time_getdate(), time_norm(), TIME_SLEN, and time_Ts::year.

Referenced by cmptest(), divmultest(), main(), subaddtest(), testlibtime(), libtime::TBaseClassTime::timestring(), and ttime_read().

40 {
41  integer day;
42  integer month;
43  static char sdate[TIME_SLEN];
44 
45  time_norm(&Date);
46 
47  if (Date.year == 0L) {
48  sprintf(sdate, "%03dd %02dh %02dm %02d.%03d%03ds", (int)Date.doy,
49  (int)Date.hour, (int)Date.minute, (int)Date.second, (int)Date.milsec, (int)Date.micsec);
50  } else {
51  time_getdate(&day, &month, Date);
52  sprintf(sdate, "%03d %02d.%02d.%04d %02d:%02d:%02d.%03d%03d",
53  (int)Date.doy, (int)day, (int)month, (int)Date.year,
54  (int)Date.hour, (int)Date.minute, (int)Date.second, (int)Date.milsec, (int)Date.micsec);
55  }
56  return(sdate);
57 } /* time_setdoy */
integer milsec
Definition: libtime.h:127
integer minute
Definition: libtime.h:125
integer hour
Definition: libtime.h:124
integer doy
Definition: libtime.h:123
void time_getdate(timeint *day, timeint *month, time_Ts Date)
Definition: ctime_getdate.c:36
void time_norm(time_Ts *Pdate)
Definition: ctime_norm.c:33
integer second
Definition: libtime.h:126
long int integer
Definition: libtime.h:64
integer year
Definition: libtime.h:122
integer micsec
Definition: libtime.h:128
#define TIME_SLEN
Definition: libtime.h:113
Here is the call graph for this function:
Here is the caller graph for this function: