Hi,
try with:
#include <time.h>
struct tm *pnow ;
long tnow ; /* or time_t, see your doc */
FILE *stream ;
char fullname[80];
......
time( &tnow ) ;
pnow = localtime( &tnow ) ; // see difference with gmtime
// the area tm is internal at
// the system function
sprintf( fullname, "%s%02d%02d%02d.txt",
"mypath", // warning at / or \\ if unix or dos
pnow->tm_year - 1900, // warining at millenium bug ??
pnow->tm_mon + 1, // Jan = 0 ??
pnow->tm_day ) ;
stream = fopen( fullname, "w" ) ; // test
fclose( stream );
-------
However, see doc in your implementation, for types and
include files, and resolve the millenium bug.
Bye