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

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

#include <xtd/xtd>
using namespace globalization;
class program {
public:
static auto main() {
auto local_date = date_time::now();
auto culture_names = array {"en-US", "en-GB", "fr-FR", "de-DE", "ru-RU"};
for (auto culture_name : culture_names) {
auto culture = culture_info {culture_name};
console::write_line("{}: {}", culture_name, local_date.to_string(culture));
}
}
};
startup_(program::main);
// This code can produce the following output :
//
// en_US: 01/02/2022 10:59:07
// en_GB: 02/01/2022 10:59:07
// fr_FR: 02.01.2022 10:59:07
// de_DE: 02.01.2022 10:59:07
// ru_RU: 02.01.2022 10:59:07
#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:168