libtime++: Date and time calculation

◆ example1()

void example1 ( )

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

Referenced by main().

44 {
45  cout << "\n"
46  << "Example 1: How many seconds are there within a day?\n"
47  << "---------­\n"
48  << "\n"
49  << " First we create a relative time span of one day length:\n";
50 
51  libtime::TRelativeTime oneday(1);
52  cout << " " << string(oneday) << endl;
53 
54  cout << "\n"
55  << " Then we create a relative time span of one second length:\n";
56 
57  libtime::TRelativeTime onesecond(0,0,0,1);
58  cout << " " << string(onesecond) << endl;
59 
60  cout << "\n"
61  << " Then we divide the one by the other:\n"
62  << " " << oneday/onesecond << endl;
63 
64  cout << " So there are " << oneday/onesecond
65  << " seconds within one day.\n"
66  << " Too easy?\n";
67 }
class to contain relative times
Definition: libtime++.h:201
Here is the caller graph for this function: