date and time function in C
well i want to store date and time in my myql database...
nowbase = localtime(&now);
hrtrans = nowbase->tm_hour;
printf("Seconds for hours: %d\n", hrtrans);
mintrans = nowbase->tm_min ;
printf("Seconds for minutes: %d\n", mintrans);
printf("SECONDS: %d\n", hrtrans + mintrans + nowbase->tm_sec);
day = nowbase->tm_mday;
printf("day of month: %d\n", day);
month = nowbase->tm_mon; // Jan==0
printf(" month of year: %d\n", month);
year = nowbase->tm_year+1900;
using this code i can get the values of..hour..minute,,day,,month and year..that is fine...but i also want to store the date in complete format..like 03.05.2003
i cant fdigure out how can i store this in the required format in database...
plz guide me
I'm not sure what date format mySQL requires. There is a mySQL section on this forum, so you might want to post your question there as well.