I've found this:
function: http://github.com/timburks/NuMongoDB/blob/master/src/bson.c#L128 bytes: http://github.com/timburks/NuMongoDB/blob/master/src/platform_hacks.h#L55 struct: http://github.com/timburks/NuMongoDB/blob/master/src/bson.h#L70
But how exactly would I use this for my iPhone app that gets the oid as a string from the server and want to extract the created_at timestamp? This is what I have so far. It's an Objective-C method, but can I put c code in my Objective-c .m file?
- timeFromBsonOid:(NSString *)oid {
time_t out;
memcpy(&out, oid, 4);
return out;
}
Matt