xtd
1.0.0
Toggle main menu visibility
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() {
auto
days_in_july =
xtd::date_time::days_in_month
(2001,
xtd::month_of_year::july
);
xtd::console::write_line
(days_in_july);
// days_in_feb gets 28 because the year 1998 was not a leap year.
auto
days_in_feb =
xtd::date_time::days_in_month
(1998,
xtd::month_of_year::february
);
xtd::console::write_line
(days_in_feb);
// days_in_feb_leap gets 29 because the year 1996 was a leap year.
auto
days_in_feb_leap =
xtd::date_time::days_in_month
(1996,
xtd::month_of_year::february
);
xtd::console::write_line
(days_in_feb_leap);
}
};
startup_
(program::main);
// This code produces the following output :
//
// 31
// 28
// 29
xtd::console::write_line
static auto write_line() -> void
Writes the current line terminator to the standard output stream using the specified format informati...
xtd::date_time::days_in_month
static auto days_in_month(xtd::uint32 year, xtd::month_of_year month) -> xtd::int32
Returns the number of days in the specified month and year.
startup_
#define startup_(...)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition
startup.hpp:284
xtd::month_of_year::july
@ july
Indicates july.
Definition
month_of_year.hpp:35
xtd::month_of_year::february
@ february
Indicates february.
Definition
month_of_year.hpp:25
Generated on
for xtd by
Gammasoft
. All rights reserved.