Shows how to use xtd::date_time::date property.
#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
class program {
public:
static auto main() {
auto date1 =
date_time {2008, 6, 1, 7, 47, 0};
console::write_line(date1.to_string());
auto date_only = date1.date();
console::write_line(date_only.to_string("d"));
console::write_line(date_only.to_string("g"));
console::write_line(date_only.to_string("u"));
}
};
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp: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.hpp:175
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10