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

Shows how to use xtd::date_time::day_of_week property.

#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
using namespace xtd;
class program {
public:
static auto main() {
// Create a DateTime for the first of May, 2003.
auto dt = date_time {2003, 5, 1};
console::write_line("Is Thursday the day of the week for {0:d}?: {1}", dt, dt.day_of_week() == day_of_week::thursday);
console::write_line("The day of the week for {0:d} is {1}.", dt, dt.day_of_week());
}
};
startup_(program::main);
// This code produces the following output :
//
// Is Thursday the day of the week for 05/01/2003?: true
// The day of the week for 05/01/2003 is thursday.
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.h:85
#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
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10