xtd 0.2.0
Loading...
Searching...
No Matches
date_time_days_in_month.cpp

Shows how to use xtd::date_time::days_in_month method.

#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
class program {
public:
static auto main() {
xtd::console::write_line(days_in_july);
// days_in_feb gets 28 because the year 1998 was not a leap year.
// days_in_feb_leap gets 29 because the year 1996 was a leap year.
xtd::console::write_line(days_in_feb_leap);
}
};
startup_(program::main);
// This code can produces the following output:
//
// 31
// 28
// 29
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static int32 days_in_month(uint32 year, month_of_year month)
Returns the number of days in the specified month and year.
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:166
@ july
Indicates july.
@ february
Indicates february.