Skip to content

Instantly share code, notes, and snippets.

@eklipse2k8
Created January 8, 2020 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eklipse2k8/68a99360928abcdf2189f55732015165 to your computer and use it in GitHub Desktop.
Save eklipse2k8/68a99360928abcdf2189f55732015165 to your computer and use it in GitHub Desktop.
// Return size of regional setting
int size = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, nullptr, 0);
// Store regional setting into language array for DateTimeFormatter
wchar_t* locale = new wchar_t[size];
size = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, locale, size);
DateTimeFormatter weekFormatter(L"dayofweek.full", winrt::single_threaded_vector<hstring>({ locale }));
delete locale;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment