Message from C, C++ discussions

November 2019

— Other than boost... do you guys suggest some other better tool to translate from date object to string and vice versa?

Message permanent page

— 

Yes, a document that contain, cascading, the details of the needs, followed by a functional specification, followed by a technical specification, each containing potentially the mathematical demonstration of the algorithms used

— Ah alright. That's for complex problems. I will be following this approach next time

— Write your own implementation, shouldn't be to hard

— Well, well, well, you are facing one of the worst problems in modern computer science. If your date object represent a timestamp, you will first want to know if it is a unix timestamp, a tai timestamp or any other form of timestamp. Then you will want to know if you want to consider leap seconds in your date representation as a string, as well as the daylight saving times, which you should, in theory, be able to access from your systems' date database

Message permanent page

— Then you will want to correctly convert your timestamp into a date and apply all of the corrections related to the previously mentioned complication before printing it as a formated string

Message permanent page

— Nah, definitely not hard /s

— It is as easy as, let's say, converting IEEE floats to a string

— It really isn't, all you need to do is like get year / month / day / time and just replace the things you want to replace with the localization (if you even want that)

Message permanent page

— Do you know that a day is not always 3600*24 seconds?

— Making a quirky, barely working implementation is easy

— Just like with a float to string implementation