/*+JMJ * LOCTIM - Print date and time in user's local time zone * Copyright 2011 David Meyer <papa@twenex.org> * * TOPS-20 DAYTIME prints only the time */ #include <stdio.h> #include <time.h> #define INIFILE "loctim.ini" char* month[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; char* wkday[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; int main() { FILE *inifile; char tzostr[7]; int tzohr, tzomin; time_t timer; struct tm *now; inifile = fopen(INIFILE, "r"); fclose(inifile); timer = time(NULL) + 9 * 3600; now = gmtime(&timer); printf(" %s, %s %d, %04d %02d:%02d:%02d UTC%s\n", wkday[now->tm_wday], month[now->tm_mon], now->tm_mday, now->tm_year + 1900, now->tm_hour, now->tm_min, now->tm_sec, "+9"); return 0; }