Jpp
Functions
JDate.cc File Reference
#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

◆ main()

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() << endl;
36 
37  JDateAndTime cal;
38 
39  cout << cal.getYear() << '/' << FILL(2,'0') << cal.getMonth() << '/' << FILL(2,'0') << cal.getDay() << endl;
40 }
JSYSTEM::getDateAndTime
static JDateAndTime getDateAndTime
Function object to get ASCII formatted date and time.
Definition: JDate.hh:195
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
FILL
Auxiliary data structure for sequence of same character.
Definition: JPrint.hh:361
JSYSTEM::JDateAndTime::getYear
int getYear() const
year a.d.
Definition: JDate.hh:96
JAANET::getTime
double getTime(const Hit &hit)
Get true time of hit.
Definition: JAAnetToolkit.hh:87
std
Definition: jaanetDictionary.h:36
JSYSTEM::getDate
const char * getDate()
Get ASCII formatted date.
Definition: JDate.hh:23
FATAL
#define FATAL(A)
Definition: JMessage.hh:67