#include <xtd/console>
#include <xtd/startup>
#include <xtd/date_time>
#include <xtd/time_span>
 
 
namespace uri_example {
  class program {
  public:
    
    static auto main() {
      
      auto date1 = 
date_time {2010, 1, 1, 8, 0, 15};
 
      auto date2 = 
date_time {2010, 8, 18, 13, 30, 30};
 
      
      
      console::write_line(
"{0} - {1} = {2}", date2, date1, interval.
to_string());
 
      
      
      console::write_line(
"   {0,-35} {1,20}", 
"Value of Days Component:", interval.
days());
 
      console::write_line(
"   {0,-35} {1,20}", 
"Total Number of Days:", interval.
total_days());
 
      console::write_line(
"   {0,-35} {1,20}", 
"Value of Hours Component:", interval.
hours());
 
      console::write_line(
"   {0,-35} {1,20}", 
"Total Number of Hours:", interval.
total_hours());
 
      console::write_line(
"   {0,-35} {1,20}", 
"Value of Minutes Component:", interval.
minutes());
 
      console::write_line(
"   {0,-35} {1,20}", 
"Total Number of Minutes:", interval.
total_minutes());
 
      console::write_line(
"   {0,-35} {1,20:N0}", 
"Value of Seconds Component:", interval.
seconds());
 
      console::write_line(
"   {0,-35} {1,20:N0}", 
"Total Number of Seconds:", interval.
total_seconds());
 
      console::write_line(
"   {0,-35} {1,20:N0}", 
"Value of Milliseconds Component:", interval.
milliseconds());
 
      console::write_line(
"   {0,-35} {1,20:N0}", 
"Total Number of Milliseconds:", interval.
total_milliseconds());
 
      console::write_line(
"   {0,-35} {1,20:N0}", 
"Ticks:", interval.
ticks());
 
    }
  };
}
 
 
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
 
#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:175
 
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
 
Represents a time interval.
Definition time_span.hpp:29
 
double total_milliseconds() const noexcept
Gets the value of the current xtd::time_span structure expressed in whole and fractional milliseconds...
 
int32 milliseconds() const noexcept
Gets the milliseconds component of the time interval represented by the current xtd::time_span struct...
 
double total_seconds() const noexcept
Gets the value of the current xtd::time_span structure expressed in whole and fractional seconds.
 
double total_days() const noexcept
Gets the value of the current xtd::time_span structure expressed in whole and fractional days.
 
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
 
int32 days() const noexcept
Gets the days component of the time interval represented by the current xtd::time_span structure.
 
int32 seconds() const noexcept
Gets the seconds component of the time interval represented by the current xtd::time_span structure.
 
int32 minutes() const noexcept
Gets the minutes component of the time interval represented by the current xtd::time_span structure.
 
int64 ticks() const noexcept
Gets the number of ticks that represent the value of the current xtd::time_span structure.
 
double total_hours() const noexcept
Gets the value of the current xtd::time_span structure expressed in whole and fractional hours.
 
double total_minutes() const noexcept
Gets the value of the current xtd::time_span structure expressed in whole and fractional minutes.
 
int32 hours() const noexcept
Gets the hours component of the time interval represented by the current xtd::time_span structure.