close
Skip to main content
New: Stack Overflow For Agents. The next generation of knowledge exchange. Learn more

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Draft saved
Draft discarded

Required fields are marked with *

Cancel
6
  • 1
    Herby requesting votes to reopen. Upon writing this Q/A I discovered that the only way to answer your own question was to not label it a request for an opinion. Furthermore, this Q/A is not just opinion. It explains a coding idiom that needs to be more well known. The existing dogma that all internal logic should stick to UTC is demonstrated false in the answer. Commented yesterday
  • 4
    neither question, nor answer has nothing to do with c++, it doesn't solve some code's problem, it is language agnostic, as you mentioned in your answer The hard part is understanding your domain well enough to know which tool is right for the job. problem here is not with chrono, but general understanding of how timezones work and how to design approach, I'd suggest to move to softwareengineering.stackexchange.com Commented yesterday
  • 2
    @IłyaBursov Challenge: Solve the example problem given in the answer in a type-safe, error-resistant, readable manner in another language. The design of C++ enabled the design of <chrono> which in turn has overturned the dogma stated in the question. The dogma is likely still good advice if you're not programming in C++. Try this in C and the compiler will not help you correct minor type-o's and think-o's. And if you happen to get it right, the code will be far less maintainable. It will be hard to read, and the type system won't help you detect minor mistakes in future maintenance. Commented yesterday
  • 1
    joda time (2000x) or java.time (2014) have the same concepts (local/zoned/etc) in their design, type safety, but none of them (including your example with chrono) are error resistant, they do no help correct minor typos/thinkos, like if you forget to use get_sys_time, I'd also challenge dogma statement, while I can imagine that some people could say that, it is nowhere near "dogma", utc is great for exact points in time (like past or now), but "everyday 7:00" is not point in time, so you just cannot use utc for this, you have to "generate local time", and then use it one way or another Commented yesterday
  • Yeah, Jon Skeet knows what's what in this area. Full respect. Oh, I'm thinking nodatime, not joda time. Commented yesterday

lang-cpp