#include #include #include #include "JSystem/JDateAndTime.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" #include "Jeep/JPrint.hh" /** * \file * * Example program to show system time. * \author mdejong */ int main(int argc, char* argv[]) { using namespace std; using namespace JPP; time_t utc_s; try { JParser<> zap("Example program to show system time."); zap['T'] = make_field(utc_s, "UTC time [s]"); zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } cout << "current:" << endl; cout << getDate() << endl; cout << getTime() << endl; cout << getDateAndTime().toString() << endl; JDateAndTime cal; cout << cal.getYear() << '/' << FILL(2,'0') << cal.getMonth() << '/' << FILL(2,'0') << cal.getDay() << endl; cout << "user:" << endl; cout << JDateAndTime(utc_s, true).toString() << endl; }