Skip to content

Commit

Permalink
Properly convert between JS dates and Cocoa dates.
Browse files Browse the repository at this point in the history
JS dates are milliseconds since epoch, while Cocoa dates are seconds since epoch.
  • Loading branch information
francois committed Jul 17, 2010
1 parent 4561c41 commit 74b645c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MEUtils.m
Expand Up @@ -54,7 +54,7 @@ +(NSObject *)objectFromBsonIterator:(bson_iterator *)it {

case bson_date:
case bson_timestamp:
return [NSDate dateWithTimeIntervalSince1970:bson_iterator_date(it)];
return [NSDate dateWithTimeIntervalSince1970:bson_iterator_date(it) / 1000L];

default:
NSLog(@"MEUtils does not handle type %d", bson_iterator_type(it));
Expand Down

0 comments on commit 74b645c

Please sign in to comment.