xtd 0.2.0
date_time_min_value.cpp

Shows how to use xtd::date_time::min_value field.

#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
using namespace xtd;
class program {
public:
static auto main() {
// Define an uninitialized date.
auto date1 = date_time {};
console::write("{:u}", date1);
if (date1.equals(date_time::min_value))
console::write_line(" (Equals date_time.min_value)");
}
};
startup_(program::main);
// This code produces the following output :
//
// 01/01/0001 00:00:00 (Equals date_time.min_value)
static void write(arg_t &&value)
Writes the text representation of the specified value to the standard output stream.
Definition console.hpp:462
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
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
#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
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8