#include <xtd/console>
#include <xtd/time_span>
#include <xtd/int64_object>
#include <xtd/string>
void gen_time_span_from_days (double days) {
auto interval = time_span::from_days(days);
auto time_interval = interval.to_string();
size_t index = time_interval.index_of( ':' );
index = time_interval.index_of( '.', index );
if (index == string::npos) time_interval += " ";
console::write_line("{0,21}{1,26}", days, time_interval);
}
int main() {
console::write_line("This example of time_span::from_days(double)\n"
"generates the following output.\n" );
console::write_line("{0,21}{1,19}",
"from_days", "time_span" );
console::write_line("{0,21}{1,19}",
"---------", "---------" );
gen_time_span_from_days(0.000000006);
gen_time_span_from_days(0.000000017);
gen_time_span_from_days(0.000123456);
gen_time_span_from_days(1.234567898);
gen_time_span_from_days(12345.678987654);
gen_time_span_from_days(0.000011574);
gen_time_span_from_days(0.000694444);
gen_time_span_from_days(0.041666666);
gen_time_span_from_days(1);
gen_time_span_from_days(20.84745602);
}
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10