Timeline for Unexpected time output in C++ program
Current License: CC BY-SA 4.0
Post Revisions
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 9, 2023 at 1:03 | comment | added | Howard Hinnant |
@interjay You are correct that chrono::years and chrono::months are just average durations. But they are quite useful as they can be used in either chronological computations or calendrical computations. See this post for an example of how to add months to a time point using both chronological and calendrical arithmetic, and a brief discussion on how both have valid use cases. Note too that with the calendrical arithmetic, one can choose to add the influence of time zones or not. Lots of choices...
|
|
| Jun 8, 2023 at 20:58 | comment | added | Howard Hinnant | What compiler are you using? | |
| Jun 8, 2023 at 18:09 | history | edited | Rakinert | CC BY-SA 4.0 |
added 291 characters in body
|
| Jun 8, 2023 at 18:08 | review | Close votes | |||
| Jun 12, 2023 at 0:05 | |||||
| Jun 8, 2023 at 18:07 | comment | added | interjay |
chrono::years and chrono::months are just the average duration. They're mostly useless because the actual duration varies based on month length and leap years.
|
|
| Jun 8, 2023 at 17:58 | comment | added | Quimby | Have you tried stepping through the code with a debugger in order to see why the seemingly incorrect time is printed? | |
| Jun 8, 2023 at 17:54 | history | edited | user4581301 |
edited tags
|
|
| Jun 8, 2023 at 17:47 | history | edited | Rakinert | CC BY-SA 4.0 |
added 381 characters in body
|
| Jun 8, 2023 at 17:46 | history | edited | Rakinert | CC BY-SA 4.0 |
added 6 characters in body
|
| S Jun 8, 2023 at 17:45 | review | First questions | |||
| Jun 8, 2023 at 19:56 | |||||
| S Jun 8, 2023 at 17:45 | history | asked | Rakinert | CC BY-SA 4.0 | created from wizard |