home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boldly Go Collection
/
version40.iso
/
TS
/
17A
/
DRWIN101.ZIP
/
TIMUTIL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-27
|
1KB
|
47 lines
#ifndef __TIMUTIL_H
#define __TIMUTIL_H
/*
YY = year
MM = month
Mon = month in letters
DD = day of month
ddd = day of week in letters
d = day of week as number
HH = hour
mm = minute
ss = seconds
hh = hundredths
*/
typedef enum
{
mm_HH_SS_hh = 0,
YYMMDD,
YYYYMMDD
} Time_Print_Types;
typedef struct TIME_struct {
int year; /*year*/
int mon; /*month (jan=1)*/
int day; /*day of month*/
int jday; /*julian day (day of year)*/
int hour; /*hour*/
int min; /*minute*/
int sec; /*second*/
int hund; /*hundredth of second*/
} TIME;
TIME *tnow(TIME *t); /*sets t to current time*/
int tcmp(TIME *t1,TIME *t2); /*compares two times (-1, 0, +1)*/
TIME *tadd(TIME *a1,TIME *a2,TIME *s); /*adds two times into a third*/
TIME *tsub(TIME *s1,TIME *s2,TIME *d); /*subtracts two times*/
int tout(TIME *to); /*returns 1 on timeout*/
TIME *toutsec(TIME *to,int sec); /*sets timeout to sec seconds*/
TIME *touthun(TIME *to,int hun); /*sets timeout to hun hundredths*/
char *tstr(TIME *t,int typ); /*time string*/
#endif