0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

un-overload appendTimeT to support MSVC

This commit is contained in:
Mathias Stearn 2009-10-15 15:23:53 -04:00
parent d6a19bb42d
commit 326f612a98
2 changed files with 4 additions and 2 deletions

View File

@ -1202,7 +1202,7 @@ namespace mongo {
@param dt a C-style 32 bit date value, that is @param dt a C-style 32 bit date value, that is
the number of seconds since January 1, 1970, 00:00:00 GMT the number of seconds since January 1, 1970, 00:00:00 GMT
*/ */
void append(const char *fieldName, time_t dt) { void appendTimeT(const char *fieldName, time_t dt) {
b.append((char) Date); b.append((char) Date);
b.append(fieldName); b.append(fieldName);
b.append(static_cast<unsigned long long>(dt) * 1000); b.append(static_cast<unsigned long long>(dt) * 1000);

View File

@ -729,9 +729,11 @@ namespace JsobjTests {
void run() { void run() {
unsigned long long before = jsTime(); unsigned long long before = jsTime();
time_t now = time(NULL); time_t now = time(NULL);
BSONObj o = BSON("now" << now);
unsigned long long after = jsTime(); unsigned long long after = jsTime();
BSONObjBuilder b;
b.appendTimeT("now", now);
BSONObj o = b.obj();
ASSERT( o.valid() ); ASSERT( o.valid() );