xtd 0.2.0
Loading...
Searching...
No Matches

◆ month_of_year

enum class xtd::month_of_year
strong

Specifies the month of the year.

Namespace
xtd
Library
xtd.core
Examples
The following example demonstrates the xtd::date_time::days_in_month method and the xtd::month_of_year enumeration.
#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 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:175
@ july
Indicates july.
@ february
Indicates february.
Remarks
The xtd::month_of_year enumeration represents the month of the year in calendars that have twelve month per year. The value of the constants in this enumeration ranges from xtd::month_of_year::january to xtd::month_of_year::december. If cast to an integer, its value ranges from one (which indicates xtd::month_of_year::january) to twelve (which indicates xtd::month_of_year::december).
This enumeration is useful when it is desirable to have a strongly typed specification of the day of the week. For example, this enumeration is the type of the property value for the xtd::date_time::day_of_week and xtd::date_time_offset::day_of_week properties.
The members of the xtd::month_of_year enumeration are not localized. To return the localized name of the month of the year, call the xtd::date_time::to_string(string) method with either the "j" or "J" format strings. The former format string produces the abbreviated month name; the latter produces the full month name.
Enumerator
january 

Indicates january.

february 

Indicates february.

march 

Indicates march.

april 

Indicates april.

may 

Indicates may.

june 

Indicates june.

july 

Indicates july.

august 

Indicates august.

september 

Indicates september.

october 

Indicates october.

november 

Indicates november.

december 

Indicates december.