Today I would like to present you operations related to date and time using Boost.DateTime library. This library contains set of classes, templates and algorithms prepared for date and time related tasks. This article focuses on date operations . Time operations will be presented in one of the future articles. Example of usage some basic Boost.DateTime date operations you can see here: Output of this example is (for day 2 January 2014): All below operations will be based on boost::gregorian namespace. We created alias dateTime for that namespace for more convenient use. In point I we are using universal_day() method for getting current day according to UTC time zone. Of course output of this and other date-related functions depends on date of invoking. Therefore you will get other output of your application every day you will invoke it. universal_day() function returns Boost date class object which has lot of functions for date manipulation and displaying. ...
Articles based on my software engineering adventure