14 std::string user, std::string port)
18 std::string cmd =
"dbname = " + dbname +
" host = " + host;
20 cmd +=
" user = " + user;
22 cmd +=
" port = " + port;
24 PGconn* conn = PQconnectdb(cmd.c_str());
26 if (PQstatus(conn) != CONNECTION_OK) {
27 std::cerr <<
"Connection to " << host <<
":" << dbname <<
" failed: " 28 << PQerrorMessage(conn) << std::endl;
48 timeinfo = gmtime(&rawtime);
49 strftime(buffer,256,
"%Y-%m-%d %H:%M:%S",timeinfo);
51 return std::string(buffer);
62 timeinfo = gmtime(&rawtime);
63 strftime(buffer,256,
"%Y-%m-%d",timeinfo);
65 return std::string(buffer);
72 return "1900-01-01 00:00:00";
77 return "2099-12-31 23:59:59";
85 if ( (sscanf(ts.c_str(),
"%d/%d/%d %d:%d:%d",
86 &ta.tm_year,&ta.tm_mon,&ta.tm_mday,
87 &ta.tm_hour,&ta.tm_min,&ta.tm_sec) == 6))
90 if ( (sscanf(ts.c_str(),
"%d-%d-%d %d:%d:%d",
91 &ta.tm_year,&ta.tm_mon,&ta.tm_mday,
92 &ta.tm_hour,&ta.tm_min,&ta.tm_sec) == 6))
110 if ( (sscanf(ts.c_str(),
"%d/%d/%d",
111 &ta.tm_year,&ta.tm_mon,&ta.tm_mday) == 3))
114 if ( (sscanf(ts.c_str(),
"%d-%d-%d",
115 &ta.tm_year,&ta.tm_mon,&ta.tm_mday) == 3))
134 char* tStr = getenv(
"_CONDOR_SCRATCH_DIR");