Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JDate.cc File Reference

Example program to show system time. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JSystem/JDate.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "Jeep/JPrint.hh"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to show system time.

Author
mdejong

Definition in file JDate.cc.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 17 of file JDate.cc.

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
std::string toString() const
Get ASCII formatted date and time.
double getTime(const Hit &hit)
Get true time of hit.
static JDateAndTime getDateAndTime
Function object to get current date and time.
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.