timestamp problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rhaymonn23
Forum Newbie
Posts: 2
Joined: Tue Nov 23, 2010 2:02 am

timestamp problem

Post by rhaymonn23 »

Hi,

I'm getting error on PHP strtotime('2010-11-23 00:00:00')
using different timezone. It output different values.

Asia/Taipei
int(1290441600)

Europe/London
int(1290470400)

expected :
Same values using timestamp

Code: Select all

        date_default_timezone_set('Asia/Taipei');
        echo $timezone = date_default_timezone_get();echo '<br />';
        var_dump(strtotime(date('2010-11-23 00:00:00')));echo '<br />';echo '<br />';

        date_default_timezone_set('Europe/London');
        echo $timezone = date_default_timezone_get();echo '<br />';
        var_dump(strtotime(date('2010-11-23 00:00:00')));echo '<br />';echo '<br />';
Why I'm getting different values?
What alternative should I use?

Thanks
Post Reply