xtd
0.2.0
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 can 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.
Generated on Mon Oct 9 2023 14:41:55 for xtd by
Gammasoft
. All rights reserved.