Shows how to use xtd::date_time::now property.
#include <xtd/collections/generic/list>
#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
class program {
public:
static auto main() {
auto locale_names =
list {
"en_US",
"en_GB",
"fr_FR",
"de_DE",
"ru_RU"};
for (auto locale_name : locale_names) {
try {
std::locale::global(std::locale {locale_name + ".utf-8"_s});
}
catch (
const std::exception&
e) {
}
}
}
};
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static xtd::string sprintf(const string &format, const date_time &value)
Returns a xtd::string that represents the current xtd::date_time.
static date_time now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
#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:167
@ e
The E key.
Definition console_key.hpp:96
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8