From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078614710517.tru64-unix-managers.marc@archive.invalid> From: Douglas Meldrum Date: Tue, 22 Jul 1997 19:12:58 +0000 To: tru64-unix-managers Subject: SUMMARY: TIME FORMAT & C2 X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078614710517 Morning, Thanks to the quick replies of : Brian H. Mayo who suggested wirting up a PERL SCRIPT Paul A Sand whos gave forth the following command: perl -e 'print scalar localtime 867287140, "\n";' and suggested the usage of "strftime" Randy M. Hayman who was kind enough to send me a C program to do the conversion ( see --secs2date -- ) All of the above satisfie my needs. Thanks again to those above for the help. ._._._. Douglas Meldrum Network Coordinator Delphi Supernet H.S.A.I.T. .-.-.-. PENDING: Summary on Disabling System Accounts REASON: Still lacking information. -----------------secs2date-------------------------------- #include /* printf() */ #include /* localtime() */ static char *weekday[7] = {"Sun","Mon","Tues","Wed","Thu","Fri","Sat"}; static char *month[12] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; struct tm *time_struct; char date_str[32] = NULL; time_t seconds; main(int argc, char *argv[]) { if( !argv[1] ) { fprintf(stdout, "usage: %s \n", argv[0]); exit(1); } (time_t)seconds = atoi(*++argv); time_struct = localtime(&seconds); sprintf(&date_str[0], " %s %02d %s %04d %d:%02d:%02d", weekday[time_struct->tm_wday], time_struct->tm_mday, month[time_struct->tm_mon], time_struct->tm_year + 1900, time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); fprintf(stdout, "\t%u seconds post-epoch is %s\n", seconds, date_str); exit(0); } ------------------------8<---------------------------- $ cc -o secs2date secs2date.c $ secs2date 867287140 867287140 seconds post-epoch is Wed 25 Jun 1997 17:05:40