Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDate.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <iomanip>
4 
5 #include "JSystem/JDate.hh"
6 #include "Jeep/JParser.hh"
7 #include "Jeep/JMessage.hh"
8 #include "Jeep/JPrint.hh"
9 
10 
11 /**
12  * \file
13  *
14  * Example program to show system time.
15  * \author mdejong
16  */
17 int main(int argc, char* argv[])
18 {
19  using namespace std;
20  using namespace JPP;
21 
22  try {
23 
24  JParser<> zap("Example program to show system time.");
25 
26  zap(argc, argv);
27  }
28  catch(const exception &error) {
29  FATAL(error.what() << endl);
30  }
31 
32 
33  cout << getDate() << endl;
34  cout << getTime() << endl;
35  cout << getDateAndTime().toString() << endl;
36 
37  JDateAndTime cal;
38 
39  cout << cal.getYear() << '/' << FILL(2,'0') << cal.getMonth() << '/' << FILL(2,'0') << cal.getDay() << endl;
40 }
Utility class to parse command line options.
Definition: JParser.hh:1517
int main(int argc, char *argv[])
Definition: Main.cc:15
std::string toString() const
Get ASCII formatted date and time.
double getTime(const Hit &hit)
Get true time of hit.
Date and time functions.
static JDateAndTime getDateAndTime
Function object to get current date and time.
I/O formatting auxiliaries.
General purpose messaging.
Auxiliary data structure for sequence of same character.
Definition: JManip.hh:328
#define FATAL(A)
Definition: JMessage.hh:67
const char * getDate()
Get current date conform ISO-8601 standard.
Utility class to parse command line options.