Forgive me if this is an obvious question, but I've done hours of searching, and I can't figure this out.
VC++ 6 / Win32 platforms
I'm trying to use strftime with the %x option to give me a date in the format specified in the users Control Panel. Though I live in the US, for example, I may have told windows that I want to see dates as dd/mm/yyyy instead of mm/dd/yyyy.
It seems that no matter what I change -- local, format, etc., I get mm/dd/yy.
This is the code:
#include "stdafx.h"
#include <time.h>
#include <ctime>
int main(int argc, char* argv[])
{
time_t oTime;
tm* oDate;
char sThis[25];
time(&oTime);
oDate = localtime(&oTime);
strftime(sThis, 25, "%x", oDate);
printf(sThis);
return 0;
}
Any ideas?
Is there a Windows API procedure that will accomplish this for me? Any help would be much appreciated.
Bryan
VC++ 6 / Win32 platforms
I'm trying to use strftime with the %x option to give me a date in the format specified in the users Control Panel. Though I live in the US, for example, I may have told windows that I want to see dates as dd/mm/yyyy instead of mm/dd/yyyy.
It seems that no matter what I change -- local, format, etc., I get mm/dd/yy.
This is the code:
#include "stdafx.h"
#include <time.h>
#include <ctime>
int main(int argc, char* argv[])
{
time_t oTime;
tm* oDate;
char sThis[25];
time(&oTime);
oDate = localtime(&oTime);
strftime(sThis, 25, "%x", oDate);
printf(sThis);
return 0;
}
Any ideas?
Is there a Windows API procedure that will accomplish this for me? Any help would be much appreciated.
Bryan