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

Incomplete 'chrono' extension documentation #1866

Closed
ghassanpl opened this issue Sep 10, 2020 · 3 comments
Closed

Incomplete 'chrono' extension documentation #1866

ghassanpl opened this issue Sep 10, 2020 · 3 comments

Comments

@ghassanpl
Copy link

It says the library supports strftime-like date and time formatting but it only seems to support it for old-style time types, and does not mention that. For std::chrono::duration the documentation does not state the valid syntax (and e.g. 'Y' is perhaps non-obviously not supported). There is also no information on the localtime and gmtime functions, even though localtime is used in the example.

@vitaut
Copy link
Contributor

vitaut commented Sep 10, 2020

{fmt} supports strftime formatting of both time and durations (https://godbolt.org/z/K8s4Mc) so that part of documentation is correct. Otherwise PRs to improve the docs are welcome.

@vitaut vitaut changed the title 'chrono' extension documentation is not correct Incomplete 'chrono' extension documentation Sep 10, 2020
@ngc92
Copy link

ngc92 commented Nov 7, 2020

At least for std::chrono::duration the strftimeformatting is not really appropriate, because e.g.

fmt::print("strftime-like format: {:%S}\n", 3h + 15min + 30s);

outputs 30 and not 11730. That might be worth pointing out in the documentation.

@vitaut
Copy link
Contributor

vitaut commented Nov 7, 2020

Expanded the docs a bit and added the Chrono Format Specifications section. Further improvements are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants