Shows how to use xtd::date_time::days_in_month method.
#include <xtd/as>
#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
#include <array>
class program {
public:
static auto main() {
auto years = std::array<unsigned int, 2> {2012, 2014};
console::write_line("Days in the Month for the Gregorian calendar\n");
console::write_line("{0,-10}{1,-15}{2,4}\n", "Year", "Month", "Days");
for (auto year : years) {
for (auto ctr = 1u; ctr <= 12u; ctr++)
console::write_line("{0,-10}{1,-15}{2,4}", year, as<month_of_year>(ctr), date_time::days_in_month(year, ctr));
console::write_line();
}
}
};
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:175
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10