7 +#include <sys/types.h>
19 - int year, month, day, hour, min, sec, daycount;
21 - /* no. of days to beginning of month for each month */
22 - static int dsboy[12] =
23 - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
24 + int year, month, day, hour, min, sec;
26 date = (uint) ((tstamp >> 16) & 0xffff);
27 time = (uint) (tstamp & 0xffff);
29 min = (time >> 5) & 0x3f;
30 sec = (time & 0x1f) * 2;
32 - daycount = 365 * (year - 1970) + /* days due to whole years */
33 - (year - 1969) / 4 + /* days due to leap years */
34 - dsboy[month-1] + /* days since beginning of this year */
35 - day-1; /* days since beginning of month */
37 - if (year % 4 == 0 &&
38 - year % 400 != 0 && month >= 3) /* if this is a leap year and month */
39 - daycount++; /* is March or later, add a day */
41 - longtime = daycount * 24L * 60L * 60L +
42 - hour * 60L * 60L + min * 60 + sec;
48 + tm.tm_mon = month - 1;
49 + tm.tm_year = year - 1900;
63 - time_t atime; /* New access time */
64 - time_t mtime; /* New modification time */
72 - m_time = mstonix(tstamp) + gettz();
74 - tb.mtime = m_time; /* Set modification time */
75 - tb.atime = m_time; /* Set access time */
76 + m_time = mstonix(tstamp); /* + gettz(); */
79 + printf ("Invalid time, set to current time!");
80 + m_time = time ((time_t *) NULL);
83 + tb.actime = m_time; /* Set modification time */
84 + tb.modtime = m_time; /* Set access time */
86 /* set the time stamp on the file */
87 return utime(name, &tb);