Twitter created_at timestamp comparing it in php
In the twitter API each 开发者_如何学Pythontweet has a timestamp a property of "created_at"
The format is "Sat Sep 17 14:48:57 +0000 2011";
The user should get a point every 24 hours for a tweet..
how will I do date compare with this timestamp in php?
$tweetTimestamp = strtotime('Sat Sep 17 14:48:57 +0000 2011');
if($tweetTimestamp > 84600) {
echo ' update tweet points';
}
else {
echo ' no points';
}
time() - $tweetTimestamp
will give you the number of seconds that have passed since $tweetTimestamp
.
$tweetTimestamp = strtotime('Sat Sep 17 14:48:57 +0000 2011');
if(time() - $tweetTimestamp > 84600) {
echo ' update tweet points';
}
else {
echo ' no points';
}
精彩评论