mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
timestampts
This commit is contained in:
parent
1ebb06ede3
commit
661156fd1a
@ -279,7 +279,11 @@ void t()
|
||||
break;
|
||||
}
|
||||
|
||||
ss << curTimeMillis() % 10000 << ' ';
|
||||
char buf[64];
|
||||
time_t_to_String(time(0), buf);
|
||||
buf[20] = 0; // don't want the year
|
||||
ss << buf;
|
||||
// ss << curTimeMillis() % 10000 << ' ';
|
||||
|
||||
{
|
||||
lock lk(dbMutex);
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "jsobj.h"
|
||||
#include "../util/goodies.h"
|
||||
#include <ctime>
|
||||
|
||||
Element nullElement;
|
||||
|
||||
@ -307,11 +306,7 @@ bool JSMatcher::matches(JSObj& jsobj, bool *deep) {
|
||||
else if( e.type() == Date ) {
|
||||
unsigned long long d = e.date();
|
||||
time_t t = (d/1000);
|
||||
#if defined(_WIN32)
|
||||
ctime_s(buf, 64, &t);
|
||||
#else
|
||||
ctime_r(&t, buf);
|
||||
#endif
|
||||
time_t_to_String(t, buf);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
@ -666,7 +666,7 @@ DiskLoc DataFileMgr::insert(const char *ns, const void *buf, int len, bool god)
|
||||
return DiskLoc();
|
||||
}
|
||||
if( tableToIndex->findIndexByName(name) >= 0 ) {
|
||||
cout << "WARNING: bad add index attempt, index:" << name << " already exists for:" << tabletoidxns << endl;
|
||||
//cout << "INFO: index:" << name << " already exists for:" << tabletoidxns << endl;
|
||||
return DiskLoc();
|
||||
}
|
||||
indexFullNS = tabletoidxns;
|
||||
|
@ -63,6 +63,17 @@ struct WrappingInt {
|
||||
bool operator>(WrappingInt r) { return !(r<=*this); }
|
||||
};
|
||||
|
||||
#include <ctime>
|
||||
|
||||
inline void time_t_to_String(time_t t, char *buf) {
|
||||
#if defined(_WIN32)
|
||||
ctime_s(buf, 64, &t);
|
||||
#else
|
||||
ctime_r(&t, buf);
|
||||
#endif
|
||||
buf[24] = 0; // don't want the \n
|
||||
}
|
||||
|
||||
inline void sleepsecs(int s) {
|
||||
boost::xtime xt;
|
||||
boost::xtime_get(&xt, boost::TIME_UTC);
|
||||
|
Loading…
Reference in New Issue
Block a user