*
*/
+#include "postgresql_store.h"
+
+#include "stg/common.h"
+
#include <string>
#include <ctime>
#include <libpq-fe.h>
-#include "stg/common.h"
-#include "postgresql_store.h"
-
extern volatile time_t stgTime;
int POSTGRESQL_STORE::StartTransaction() const
char * buf = new char[(value.length() << 1) + 1];
PQescapeStringConn(connection,
- buf,
- value.c_str(),
- value.length(),
- &error);
+ buf,
+ value.c_str(),
+ value.length(),
+ &error);
if (error)
{
std::string POSTGRESQL_STORE::Int2TS(time_t ts) const
{
-char buf[32];
struct tm brokenTime;
brokenTime.tm_wday = 0;
gmtime_r(&ts, &brokenTime);
+char buf[32];
strftime(buf, 32, "%Y-%m-%d %H:%M:%S", &brokenTime);
return buf;
else
{
time_t curTime = stgTime;
- /*time(&curTime);*/
-
localtime_r(&curTime, &brokenTime);
}
date = buf;
}
-