xtd
1.0.0
Toggle main menu visibility
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 :
//
// 10/23/2025 1:06:35 AM
// 11/28/2025 1:06:35 AM
xtd::console::write_line
static auto write_line() -> void
Writes the current line terminator to the standard output stream using the specified format informati...
xtd::date_time::now
static auto now() noexcept -> date_time
Gets a xtd::date_time object that is set to the current date and time on this computer,...
startup_
#define startup_(...)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition
startup.hpp:284
Generated on
for xtd by
Gammasoft
. All rights reserved.