Re: stftime differences on Windows/Linux platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/11/2007, Neil Saunders <n.j.saunders@xxxxxxxxx> wrote:
> Hi All,
>
> I'm experiencing some differences in in the return values of strftime
> on Windows & Linux platforms on PHP 5.2.1. I've knocked up a test case
> to demonstrate the bug:
>
> <?php
>
> $UNIX_TIME = mktime(0,0,0,5,31,2008);
> echo "Time Made for 31-05-2008:                  $UNIX_TIME\n";
> echo "Expected Time for 31-05-2008:              1212188400\n";
> echo "Formated generated:                        " .
> strftime("%d-%m-%Y", $UNIX_TIME) . "\n";
> echo "Formated expected:                         " .
> strftime("%d-%m-%Y", 1212188400) . "\n";
> echo "Difference between expected and generated: " . ($UNIX_TIME - 1212188400);
> echo "\n\n";
> ?>
>
> OUTPUT DEVELOPMENT:
>
> C:\>php -e c:\test.php
> Time Made for 31-05-2008:                  1212188400
> Expected Time for 31-05-2008:              1212188400
> Formated generated:                        31-05-2008
> Formated expected:                         31-05-2008
> Difference between expected and generated: 0
>
> OUTPUT PRODUCTION:
>
> Time Made for 31-05-2008:                  1212192000
> Expected Time for 31-05-2008:              1212188400
> Formated generated:                        31-05-2008
> Formated expected:                         30-05-2008
> Difference between expected and generated: 3600
>
> Development Config:
> ------------------------------------
> PHP Version 5.2.1
> PHP API     20041225
> PHP Extension     20060613
> Zend Extension     220060519
>
> Production Config:
> ------------------------------------
> PHP Version 5.2.1
> Build Date     Apr 25 2007 18:04:12
> PHP API     20041225
> PHP Extension     20060613
> Zend Extension     220060519
>
> Am I missing something obvious here? Any help gratefully received.

Well, either the clocks on your dev and production servers are exactly
6 hours out or there's a difference in their locale settings such that
one thinks it's in a timezone 6 hours ahead of the other.

-robin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux