103 std::cout <<
"Hello world!\n";
105 std::cout <<
"\nTesting constructors" 106 <<
"\n====================" << endl;
108 std::cout <<
"\nTesting TAbsoluteTime" 109 <<
"\n---------------------" << endl;
110 init_from_string<libtime::TAbsoluteTime>(
"0/1/1");
111 init_from_string<libtime::TAbsoluteTime>(
"70/1/1");
112 init_from_string<libtime::TAbsoluteTime>(
"60/1/1");
113 init_from_string<libtime::TAbsoluteTime>(
"160/1/1");
114 init_from_string<libtime::TAbsoluteTime>(
"1978/1/1");
115 init_from_string<libtime::TAbsoluteTime>(
"1978/13/1");
116 init_from_string<libtime::TAbsoluteTime>(
"1978/1/2/3/4/5/6/7/8/9");
123 std::cout <<
"\nTesting TRelativeTime" 124 <<
"\n---------------------" << endl;
125 init_from_string<libtime::TRelativeTime>(
"0");
126 init_from_string<libtime::TRelativeTime>(
"8");
127 init_from_string<libtime::TRelativeTime>(
"123.23.34.45.56789");
128 init_from_string<libtime::TRelativeTime>(
"123.2345.34567.45678.56789");
149 cout << string(Q) << endl;
150 cout << string(OneSecond) << endl;
151 cout << string(Q%OneSecond) << endl;
152 long int numbo=Q/OneSecond;
153 cout << Q/OneSecond << endl;
154 cout << string(OneSecond*numbo) << endl;
155 numbo=(Now-Then)/OneSecond;
156 cout << numbo <<
" seconds from " 157 << string(Now) << endl <<
" to " << string(Then) << endl;
159 cout <<
"these are " << string(Q) << endl <<
" and lead to " 160 << string(Now+Q) << endl <<
" from " << string(Now) << endl;
166 std::cout <<
"hierarchical strings:" << std::endl;
169 std::cout << Atime.timestring() << std::endl;
170 std::cout << Atime.hierarchicalstring() << std::endl;
171 std::cout << Rtime.timestring() << std::endl;
172 std::cout << Rtime.hierarchicalstring() << std::endl;
175 std::cout <<
"\nSystematically test derived units" 176 <<
"\n---------------------------------" << endl;
double time2double(const TRelativeTime &rtime)
convert relative time to seconds
provide a convenient way to specify time intervals in the order of one hour
provide a convenient way to specify time intervals in the order of one microsecond ...
TAbsoluteTime utc()
return system time in UTC
provide a convenient way to specify time intervals in the order of one day
void Ainit_from_value(const long int &year, const long int &month, const long int &day, const long int &hour=0, const long int &minute=0, const long int &second=0, const long int &milsec=0, const long int &micsec=0)
class to contain relative times
provide a convenient way to specify time intervals in the order of one minute
std::string timestring(const std::string &format) const
return string representation of time.
provide a convenient way to specify time intervals in the order of one millisecond ...
void Rinit_from_value(const long int &days, const long int &hour=0, const long int &minute=0, const long int &second=0, const long int &milsec=0, const long int &micsec=0)
TAbsoluteTime now()
return system time
provide a convenient way to specify time intervals in the order of one second
class to contain absolute times
void init_from_seconds(const double &seconds)