ID:               28209
 Comment by:       wb at pro-net dot co dot uk
 Reported By:      gamin at centras dot lt
 Status:           Assigned
 Bug Type:         Date/time related
 Operating System: WinXP HE SP1
 PHP Version:      5.0.0RC2
 Assigned To:      derick
 New Comment:

Hi derick,

    Yes that is strange, What about adding an optional parameter to the
function to set toggle between real now and gnu now?

    Something like:

        int strtotime ( string time [, int now] [, bool gnu = false])


Previous Comments:
------------------------------------------------------------------------

[2004-05-18 21:53:44] [EMAIL PROTECTED]

This is actually expected behavior because we follow the GNU guidelines
here, but I agree it's a weird thing to do. If nobody objects I'll make
"now" be really now during the rewrite of the strtotime() rewrite.

------------------------------------------------------------------------

[2004-05-18 12:28:09] wb at pro-net dot co dot uk

Im seeing the same thing on FreeBSD 5 with PHP5 rc2.

code: 

<?php
$strtime = strtotime('now');
printf('
     Now:  %11s  %s
Str time:  %11s  %s

'
, time()
, date('d M Y @ H:i:s ')
, $strtime
, date('d M Y @ H:i:s ', $strtime)
);
?>

Expected:


     Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084875653  18 May 2004 @ 11:20:53


Actual:


     Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084834800  18 May 2004 @ 00:00:00

------------------------------------------------------------------------

[2004-04-28 21:06:33] gamin at centras dot lt

Description:
------------
Simple script... doesn't matter how much time i run it -
strototime("now") produces same result for whole day. On next month day
it produces same result. Seems i didn't have any problem on RC1.

Reproduce code:
---------------
$str = "now";
$timestamp = strtotime($str);
echo "$str == " . date('l dS of F Y h:i:s A', $timestamp) . "<br
/>\n";
$timestamp = time();
echo "Good is " . date('l dS of F Y h:i:s A', $timestamp) . "<br
/>\n";


Expected result:
----------------
now == Wednesday 28th of April 2004 10:02:54 PM
Good is Wednesday 28th of April 2004 10:02:54 PM

Actual result:
--------------
now == Wednesday 28th of April 2004 12:00:00 AM
Good is Wednesday 28th of April 2004 10:02:54 PM


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28209&edit=1

Reply via email to