date_default_timezone_set('..');//I place my date here
$TweetPHP = new TweetPHP();
It seem this related to
date_default_timezone_set();then I type
date_default_timezone_set('UTC');
$TweetPHP = new TweetPHP();
and worked fine?! but before I tried this step to found out something interested
TESTING
This testing related to twitter setting and my script!TEST 1 TEST ON DUMMY
Twitter : using +7 timeThis test not using any date_default_timezone_set(). I testing there is no problem. The twitter show fine?
my script : not using date setting
TEST 2 TEST USING DATE SETTING
Twitter : using +7 timeThis test using any date_default_timezone_set(). I testing there is a problem! the time is forward to 7?!?
my script : using date setting
TEST 3 EDIT TWITTER TIME
Twitter : using gmtThis test using any date_default_timezone_set(). Don't forget I'm using GMT on twitter. Normaly I should have correct time. I testing there is a problem! the time is forward to 7?!? This is very strange actualy. Then I change back into my original time.
my script : using date setting
CONCLUSION
I think using UTC
date_default_timezone_set('UTC');
before execute $TweetPHP = new TweetPHP(); is better option. But I suggested before you run any code that called the twitter API. After done tried to return you timezone back. I like to add date_default_timezone option and put new line that related to date_default in the TweetPHP file. But I think is wise not to edit any code inside.
Tidak ada komentar:
Posting Komentar