Geeks With Blogs
John Conwell: aka Turbo Research in the visual exploration of data
When using the Twitter Search API, the returned posts contain a "created_at" date time stamp with the time set to GMT time. This becomes an issue when using pymongo to store the datetime object in MongoDB. When a datetime object gets stored in MongoDb, mongo (or the pymongo library) updates the datetime object to reflect the current timezone.

So in my case, since I live in Seattle, the datetime values get offset by 8 hours. For example, a Twitter post with a timestamp of "12/21/2010 06:07:56" gets stored in MongoDB with a value of "12/20/2010 22:07:56 -0800", which is really the same. Its saying its 22:07 plus 8 hours.

This behavior is good to keep this in mind when debugging your analytics, especially where grouping by date.

I'm not sure if the pymongo library is doing this or if its mongodb. But it can make a difference. Consider if the server running your python script is in New York and the server hosting MongoDb is in San Fran. Then things could really get fun in debugging the issue.

Posted on Tuesday, May 17, 2011 9:24 AM MongoDb | Back to top


Comments on this post: Twitter Search Results and GMT

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © John Conwell | Powered by: GeeksWithBlogs.net