Hi
I am making a function that finds what todays date is & returns it as a string to main. (string format dd/mm/yy).
My problem is I have found out how to find the day, month & year, but I cant put it into a string & return it to main. Any advice?
string date()
{
SYSTEMTIME time;
GetLocalTime( &time );
int hour = time.wHour;
if (hour > 12) hour -= 12;
cout << time.wMonth << "/" << time.wDay << "/" << time.wYear << endl;
cout << hour << ":" << time.wMinute << endl;
int a = time.wDay;
// attempt to put date into a string
std::string date("");
date += time.wDay;
date += "/";
date += time.wMonth;
date += "/";
date += time.wYear;
//attempt to just return the values but wont work, should this function be int or something else??
return time.wDay;
return time.wMonth;
return time.wYear;
}