Why is C++ so terrible when it comes to date/time manipulation?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aryankanse6
    New Member
    • Jun 2020
    • 3

    Why is C++ so terrible when it comes to date/time manipulation?

    This is just a rant, but I love C++, and its such a massive and influential language, but why is it that while most other major programming languages have nice, convenient built in libraries for things like parsing a datetime string, or printing a datetime as a string (even C has strftime and related functions), with the STL we have to wait until C++20 before anybody even considers adding date and time functionality to chrono (and who knows if that will actually be any good)? I'm not even talking about timezones. I will be developing some project, having a great time, and then all of a sudden there is a need (a quite common need) for manipulating or generating timestamps, and my heart will sink.

    And once again I do what it seems like virtually everybody else does, I run crying to our date and time Lord and Savior Howard Hinnant, without whom we would be lost forever.

    Seriously, that guy is the crutch for damn near the entire C++ world when it comes to date and time. I really don't get why there is such a gaping hole in the STL here.
    Last edited by Niheel; Feb 14 '21, 03:32 PM. Reason: remove link
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    You are not supposed to use the STL as a production library. The STL contains only basic stuff to get you started. It's for students learning C or C++. Many places don't use the STL at all and instead have purhased (or written) their own library.

    Look at cell formatting in Microsoft EXCEL and you will see what I mean. Date handling is its own library.

    Comment

    Working...