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

String format documentation incorrect #202

Closed
kiranshila opened this issue Feb 14, 2023 · 1 comment · Fixed by #207
Closed

String format documentation incorrect #202

kiranshila opened this issue Feb 14, 2023 · 1 comment · Fixed by #207
Assignees
Labels

Comments

@kiranshila
Copy link

The documentation says:

%H Minute number, zero-padded to 2 digits 39 for the 39th minutes of the hour N/A

but that is inconsistent with the C89 value. %H should be hour as a decimal number, 24 hour clock (range [00-23]). Additionally, the minute format, %M seems to be missing, which is what the %H description seems to be for.

@ChristopherRabotin
Copy link
Member

ChristopherRabotin commented Mar 12, 2023

I looked into it, and the documentation is wrong but the functionality is correctly implemented. I'll add a specific test to show that, but there should be not need for a code change.

The following test is successful (and will be added to close this issue).

let e = Epoch::from_gregorian_utc_hms(2015, 2, 7, 11, 22, 33);
let fmtd = Formatter::new(e, Format::from_str("%H:%M").unwrap());
assert_eq!(format!("{fmtd}"), format!("11:22"));

ChristopherRabotin added a commit that referenced this issue Mar 12, 2023
Also reenabled `formal_duration_seconds` kani testing

Signed-off-by: Christopher Rabotin <[email protected]>
ChristopherRabotin added a commit that referenced this issue Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants