Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt ignores locale #342

Closed
dermariusz opened this issue Jun 12, 2016 · 2 comments
Closed

fmt ignores locale #342

dermariusz opened this issue Jun 12, 2016 · 2 comments

Comments

@dermariusz
Copy link

dermariusz commented Jun 12, 2016

    std::setlocale(LC_ALL, "de_DE");
    std::time_t t = std::time(nullptr);
    std::tm *local_tm = std::localtime(&t);
    assert(local_tm != nullptr);
    fmt::print("de_AT: {:%A, %e. %B %Y}\n", *local_tm);

Output:

de_AT: Sunday, 12. June 2016

I found this Issue #305 but i honestly don't know how to apply it on my code.

@vitaut
Copy link
Contributor

vitaut commented Jun 12, 2016

Time formatting uses strftime so the current locale should apply. Do you have de_AT locale installed? You can get the list of locales with the following command:

locale -a

@vitaut
Copy link
Contributor

vitaut commented Jun 12, 2016

Here's the output that I get after installing de_AT locale:

de_AT: Sonntag, 12. Juni 2016

@vitaut vitaut closed this as completed Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants