Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <iostream>
- using namespace std;
- int main()
- {
- wchar_t timeSeparator[] = { 0, 0, 0, 0 }; // Can be up to four characters
- wchar_t timeFormat[256];
- ZeroMemory(timeFormat, sizeof(timeFormat));
- GetLocaleInfoEx(L"nb-NO", LOCALE_STIME, timeSeparator, sizeof(timeSeparator) >> 1); // Note that LOCALE_STIME is deprecated.
- GetLocaleInfoEx(L"nb-NO", LOCALE_STIMEFORMAT, timeFormat, sizeof(timeFormat) >> 1);
- wchar_t foundSeparator = L' ';
- for (auto ch : timeFormat)
- {
- if (!isalpha(ch))
- {
- foundSeparator = ch;
- break;
- }
- }
- wcout << "The time separator is '" << timeSeparator << "' and the time format is '" << timeFormat << "' which should use the separator '" << foundSeparator << "'." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement