HP C/iX Library Reference Manual (30026-90004)
Chapter 5 261
HP C/iX Library Function Descriptions
mktime
By default, mktime adjusts the returned value to the Eastern Standard Time (EST) zone.
You may override this default behavior by using the MPE/iX command SETVAR TZ name.
Time zone names, and the format of TZTAB.LIB.SYS file containing time zone offsets from
GMT are listed in appendix A, "Time Zones."
Example
What day of the week is July 4, 2001?
#include <stdio.h>
$include <time.h>
static const char *const wday[] = {
"Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday",
"Saturday", "-unknown"
};
struct tm time_str;
time_str.tm_year = 2001 - 1900;
time_str.tm_mon =7-1;
time_str.tm_mday = 4;
time_str.tm_hour = 0;
time_str.tm_min = 0;
time_str.tm_sec = 1;
time_str.tm_isdst = -1;
if (mktime(time_str) == -1)
time_str.tm_wday = 7;
printf("%s\n", wday[time_str.tm_wday]);
See Also
clock(), difftime(), time(), ANSI C 4.12.2.3, POSIX.1 8.1