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

Shows how to use xtd::date_time::add_days method.

#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
class program {
public:
static auto main() {
// Calculate what day of the week is 36 days from this instant.
auto today = xtd::date_time::now();
auto answer = today.add_days(36);
xtd::console::write_line("{0}", today);
xtd::console::write_line("{0}", answer);
}
};
startup_(program::main);
// This code can produce the following output :
//
// Wed Jan 12 14:06:34 2022
// Thu Feb 17 14:06:34 2022
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
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.h:175