BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
test_time.cxx
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/facilities/src/test/test_time.cxx,v 1.1.1.1 2005/10/17 06:11:40 maqm Exp $
2/** @file test_meta.cxx
3 Sample program to exercise calibration metadata database services
4*/
5
6#include <string>
7#include <iostream>
9
10
11int main(int, char**) {
14
15
16 try {
17 // Timestamp t_ok("2001-11-10 08:00");
18 // Timestamp t_none("2000-09-08 10:00");
19 long int zero = 0;
20 // long int negValue = -2000;
21 Timestamp unixCreation(zero);
22 // Timestamp gmttest("1970-01-01 00:00");
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}
58
const DifNumber zero
std::string getString() const
Return string representation of time, not including nanoseconds;.
Definition: Timestamp.cxx:92
int main()
Definition: test_IFile.cxx:11