PHP Reverse strtotime()

Hello, Take a look at this php script: <?php date_default_timezone_set('Africa/Nairobi'); echo strtotime("Wed, 2011-Apr-06 13:41") . "\n"; ?> I run it to produce this: sh-4.1$ php test.php 1302086460 Now, lets do the reverse: I took the results above and now have this: <?php date_default_timezone_set('Africa/Nairobi'); echo date("D, Y-M-d H:m", "1302086460") . "\n"; ?> Which produces: sh-4.1$ php test.php Wed, 2011-Apr-06 13:04 Question is, where have my 37 minutes vanished to? If you need a little bit more info: sh-4.1$ php -version PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

seconds are denoted by i not m, ur minutes are still there echo date("D, Y-M-d H:i", "1302086460") . "\n"; On Thu, Apr 21, 2011 at 12:14 PM, Arthur Buliva <arthurbuliva@hotmail.com>wrote:
Hello,
Take a look at this php script:
<?php date_default_timezone_set('Africa/Nairobi'); echo strtotime("Wed, 2011-Apr-06 13:41") . "\n"; ?>
I run it to produce this:
sh-4.1$ php test.php 1302086460
Now, lets do the reverse:
I took the results above and now have this:
<?php date_default_timezone_set('Africa/Nairobi'); echo date("D, Y-M-d H:m", "1302086460") . "\n"; ?>
Which produces:
sh-4.1$ php test.php Wed, 2011-Apr-06 13:*04*
Question is, where have my 37 minutes vanished to?
If you need a little bit more info:
sh-4.1$ php -version PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Thanks Chris! On Thu, 2011-04-21 at 12:27 +0300, Chris Mwirigi wrote:
seconds are denoted by i not m, ur minutes are still there
echo date("D, Y-M-d H:i", "1302086460") . "\n";
On Thu, Apr 21, 2011 at 12:14 PM, Arthur Buliva <arthurbuliva@hotmail.com> wrote: Hello,
Take a look at this php script:
<?php date_default_timezone_set('Africa/Nairobi'); echo strtotime("Wed, 2011-Apr-06 13:41") . "\n"; ?>
I run it to produce this:
sh-4.1$ php test.php 1302086460
Now, lets do the reverse:
I took the results above and now have this:
<?php date_default_timezone_set('Africa/Nairobi'); echo date("D, Y-M-d H:m", "1302086460") . "\n"; ?>
Which produces:
sh-4.1$ php test.php Wed, 2011-Apr-06 13:04
Question is, where have my 37 minutes vanished to?
If you need a little bit more info:
sh-4.1$ php -version PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
participants (2)
-
Arthur Buliva
-
Chris Mwirigi