Mail Archives: djgpp/1999/08/01/23:08:06
I propose, in the interest of avoid harse comments from the more
"seasoned" C/C++ users, that perhaps we should create a NEW
newsgroup
comp.os.msdos.djgpp.beginner
and they in there, new comers can be treated with the proper
respect due them.
I still would like to see a working example of strftime
since I haven't been successful getting the LIBC.hlp
example to work for me yet.
/* This DJGPP program PROPERLY displays the
Current Date/Time (as set by the PC's system time).
NOTE: I still have NO WORKING EXAMPLE of how to do this
using 'strftime'; if you have a WORKING example
example for strftime, I would be happy to test
it.
*/
#include <stdio.h>
#include <string.h>
#include <time.h>
time_t now;
int main(void) {
char buf[100];
time(&now);
strcpy( buf, asctime(localtime(&now)) );
printf("The current date/time is %s", buf );
}
/* Outputs:
The Current Date/Time is: Aug 1 22:59:56 1999
(which was correct at "that" time, hehe)
*/
- Raw text -