Why would you want that in the first place? The API returns the time in 24h format.
Also, in C++, you would do it this way to avoid system-dependent calls (code being entirely portable):
Code:
#include <iostream>
#include <ctime>
#include <chrono>
int main()
{
auto today = std::chrono::system_clock::now();
auto tt = std::chrono::system_clock::to_time_t(today);
std::cout << "Today is: " << ctime(&tt);
return 0;
}
Also, in C++, do not use wsprintf and do not use char/wchar_t/TCHAR. You are strongly recommended to use std::string/std::wstring and std::stringstream/std::wstringstream.