libtime++: Date and time calculation

◆ example4()

void example4 ( )

Definition at line 185 of file example++.cc.

Referenced by main().

186 {
187  libtime::TAbsoluteTime first, second;
188 
189  cout << "\n"
190  << "Example 4: How about leap-years?\n"
191  << "----------\n"
192  << "\n";
193 
194  first="1979/02/15"; second="1979/03/01";
195  cout << "\n"
196  << " The time span between " << string(first) << endl
197  << " and " << string(second) << endl
198  << " is " << string(second-first) << endl;
199 
200  first="1980/02/15"; second="1980/03/01";
201  cout << "\n"
202  << " The time span between " << string(first) << endl
203  << " and " << string(second) << endl
204  << " is " << string(second-first) << endl;
205 
206  first="2000/02/15"; second="2000/03/01";
207  cout << "\n"
208  << " The time span between " << string(first) << endl
209  << " and " << string(second) << endl
210  << " is " << string(second-first) << endl;
211 
212  first="2100/02/15"; second="2100/03/01";
213  cout << "\n"
214  << " The time span between " << string(first) << endl
215  << " and " << string(second) << endl
216  << " is " << string(second-first) << endl;
217 }
class to contain absolute times
Definition: libtime++.h:149
Here is the caller graph for this function: