11 {
14
15
16 try {
17
18
20
21 Timestamp unixCreation(
zero);
22
23 long int aTime = 4000;
24
25 Timestamp aTimestamp(aTime);
27
28 std::cout <<
"unix creation time is " << unixCreation.
getString()
29 << std::endl;
30
31
32 std::cout << "aTimestamp is " << aTimestamp.getString()
33 << std::endl;
34
35 std::cout <<
"cur time (GMT) is " << cur.
getString()
36 << std::endl;
37
38 std::string missionStartString("2001-1-1 00:00");
39
40 Timestamp missionStart(missionStartString);
41
42 std::cout << "Supplied string: " << missionStartString << std::endl;
43 std::cout << "Retrieved: " << missionStart.getString() << std::endl;
44
45 std::string PDTString("2005-4-4 12:25");
46 Timestamp PDTTime(PDTString, 25200);
47
48 std::cout << "Supplied PDT string: " << PDTString << std::endl;
49 std::cout << "Retrieved: " << PDTTime.getString() << std::endl;
50 }
51 catch (const BadTimeInput e) {
52 std::cout << "Exception message: " << e.complaint << std::endl;
53 }
54
55 return 0;
56
57}
std::string getString() const
Return string representation of time, not including nanoseconds;.