#include <xtd/console>
#include <xtd/date_time>
#include <xtd/environment>
#include <xtd/format>
enum class cap {title, middle,
end};
auto print_date_time(
const string&
text,
const date_time& value, cap
c) {
<<
"┌───────────────────────────────────────┬────────────┬──────────────────────────────────────────┐" <<
environment::new_line
<<
"├───────────────────────────────────────┼────────────┼──────────────────────────────────────────┤" <<
environment::new_line;
else
}
auto main() -> int {
print_date_time(
"date_time {}",
date_time {}, cap::title);
print_date_time(
"date_time {123456789123456789}",
date_time {123456789123456789}, cap::middle);
print_date_time(
"date_time {1971, 1, 5}",
date_time {1971, 1, 5}, cap::middle);
print_date_time(
"date_time {1971, 1, 5, 21, 30, 3}",
date_time {1971, 1, 5, 21, 30, 3}, cap::middle);
print_date_time(
"date_time {1971, 1, 5, 21, 30, 3, 42}",
date_time {1971, 1, 5, 21, 30, 3, 42}, cap::middle);
}
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
static date_time utc_now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
static const date_time min_value
Represents the smallest possible value of xtd::date_time. This field is read-only.
Definition date_time.hpp:107
static date_time now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
static const date_time max_value
Represents the largest possible value of xtd::date_time. This field is read-only.
Definition date_time.hpp:97
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
@ c
The C key.
Definition console_key.hpp:92
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const_iterator end() const
Returns an iterator to the end.
Definition read_only_span.hpp:213