i have a online logging of data through com port.
the c program captures the online data every 1 minute, calculates ten minute average, standard deviation and then writes it to a file.
the file is created with getdate function.
when the day changes, i have to create the new file with the new date which is not happening. can someone help.
i can send the code if interested.

--kumar

The way I did it was create a new filename every time I wanted to open the file. That way when the date changes my algorithm will automatically pick up the new date.

time_t now = time(0);
struct tm* tm = localtime(&now);
char filename[255];
sprintf(filename,"%04d%02d%02d", 
    tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
// now open the file
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.