开发者

Comparing ruby DateTime with sqlite Date

I am attempting to pull tweets from twitter and store them in an sqlite db. In order to prevent duplication I wish to ignore tweets where the user开发者_如何学Python AND the time created already exist in the DB. So my code is

if Tweet.exists?(['twitter_created_at = ? AND from_user_id_str = ?', (tweet_results.created_at), tweet_results.from_user_id_str])

Now, through taking out the user_id parts i can tell that the problem is with the comparison between

twitter_created_at

tweet_results.created_at

I have been in the debugger and seen that the dates do match but i cannot get the statement to come back true.

thanks in advance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜