Is there a standard date/time class in C++?

Not part of STL but well known library is boost.

I would go the way of using boost::date. Here are some examples:

If you did not try out boost yet I encourage you to do so as it saves you from a lot of nasty issues, as it masks most OS dependent things like threading for example. Many things in boost are header only (template libraries). However datetime requires a lib or dll.

Leave a Comment