16
Code block
#pragma code ("kernel32.dll")
void GetLocalTime (LPSYSTEMTIME lpSystemTime);
int GetDateFormatA (DWORD Locale, DWORD dwFlags, const SYSTEMTIME* lpDate, LPCSTR lpFormat, LPSTR lpDateStr, int cchDate);
#pragma code()
DWORD lcidLanguage = 0x40a; // will be used for names of months and days (if used for formating)
char szFormated[100];
SYSTEMTIME stNow;
GetLocalTime (&stNow);
GetDateFormatA (lcidLanguage, 0, &stNow, "dd-MM-yyyy, or if you like strange formats, a sunny dddd, MMM(MMMM)__yyyy§dd", szFormated, sizeof(szFormated));
printf ("Formated date: %s\r\n", szFormated);