The following code (Windows, C++) sets the current locale and retrieves a formatted short date string, formatted according to locale's short date format "%c".
time_t rawtime;
struct tm * timeinfo;
char buffer [80];
time (&rawtime);
timeinfo = localtime (&rawtime);
strftime (buffer,80,"%c",timeinfo);
Say this gives "31/01/2012" for a given date and locale. This corresponds to a date format of "%d/%m/%Y", although "%c" has been specified.
Is there a way i can get the format string itself, i.e. "%d/%m/%Y" for a given locale?