- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
time_t t = time(NULL);
struct tm tm = *localtime(&t);
char day[3], month[3], year[5], toDay[15] = "";
//converting time ints to strings.
sprintf(day, "%d", tm.tm_mday);
sprintf(month, "%d", (tm.tm_mon + 1));
sprintf(year, "%d", tm.tm_year + 1900);
//string connecting.
strcat(toDay, day);
strcat(toDay, "/");
strcat(toDay, month);
strcat(toDay, "/");
strcat(toDay, year);