hi,
i need to be able to get the current date but i want to be able to store the day, month and year in separate variables.
thanks
Printable View
hi,
i need to be able to get the current date but i want to be able to store the day, month and year in separate variables.
thanks
Code:
void get_date( int * month, int * day, int * year ) {
struct tm *current;
time_t timenow;
time(&timenow);
current = localtime(&timenow);
*month = current->tm_mon+1;
*day = current->tm_mday;
*year = current->tm_year+1900;
return;
}
thanks Sebastiani