i seem to having a lot! of trouble getting the system date into this format yyyymmdd and i have been trying out the time_t struct thing but i cant seem to get it to work... when i try to display things using it crashes anyone have any examples
i seem to having a lot! of trouble getting the system date into this format yyyymmdd and i have been trying out the time_t struct thing but i cant seem to get it to work... when i try to display things using it crashes anyone have any examples
Code:#include <stdio.h> #include <time.h> int main ( ) { char buff[100]; time_t now; now = time(NULL); strftime( buff, sizeof(buff), "%Y%m%d", localtime(&now) ); printf( "Now=%s\n", buff ); return 0; }
salem i bow down to you lol i cant believe my problem was this simple! i forgot to time(NULL);