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

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

#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
using namespace xtd;
class program {
public:
static auto main() {
// Get the current date.
auto this_day = date_time::today();
// Display the date in the default (general) format.
console::write_line(this_day.to_string());
console::write_line();
// Display the date in a variety of formats.
console::write_line(this_day.to_string("d"));
console::write_line(this_day.to_string("D"));
console::write_line(this_day.to_string("g"));
}
};
startup_(program::main);
// This code can produce the following output :
//
// Wed Jan 12 00:00:00 2022
//
// 01/12/2022
// 1/12/2022
// Wed Jan 12 00:00:00 2022
#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