ID:               28599
 Updated by:       [EMAIL PROTECTED]
 Reported By:      fr33k at techie dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Date/time related
 Operating System: Debian
 PHP Version:      4.3.5
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Hmm, can you try the latest snapshot please?


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

[2004-06-03 02:24:31] fr33k at techie dot com

Looks identical to me?

# dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name                      Version                   Description
+++-=========================-=========================-==================================================================
ii  libc6                     2.3.2.ds1-12              GNU C Library:
Shared libraries and Timezone data

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

[2004-06-01 08:13:01] [EMAIL PROTECTED]

Works fine for me. Which glibc do you have on your system? I've 2.3.2:

[EMAIL PROTECTED]:~$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  libc6          2.3.2.ds1-12   GNU C Library: Shared libraries and
Timezone


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

[2004-06-01 07:53:09] fr33k at techie dot com

Sorry, pasted the "actual result" in the description.

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

[2004-06-01 07:49:36] fr33k at techie dot com

Description:
------------
When strtotime encounters certain intervals while using a zero "now"
time as the second argument, it fails. Some intervals fail, others work
fine. All worked fine with a non-zero "now" date. I was using this as a
convenient way to translate intervals like "+1 Week" into seconds.





0+1 Day: 86400
0+2 Days: 172800
+3 Days: 1086327304
104022382+3 Days: 104281582
0+3 Days: -1
+332 Days: 1114752904
0+332 Days: -1
0+1 Week: -1
0+4 Weeks: -1
0+1 Month: 2678400
0+3 Months: 7776000
0+1 Year: 31536000
0+4 Years: 126230400

Reproduce code:
---------------
print "0+2 Days: ".strtotime('+2 Days',0)."\n";
print "+3 Days: ".strtotime('+3 Days')."\n";
print "104022382+3 Days: ".strtotime('+3 Days',104022382)."\n";
print "0+3 Days: ".strtotime('+3 Days',0)."\n";
print "+332 Days: ".strtotime('+332 Days')."\n";
print "0+332 Days: ".strtotime('+332 Days',0)."\n";
print "0+1 Week: ".strtotime('+1 Week',0)."\n";
print "0+4 Weeks: ".strtotime('+4 Weeks',0)."\n";
print "0+3 Months: ".strtotime('+3 Months',0)."\n";
print "0+1 Year: ".strtotime('+1 Year',0)."\n";

Expected result:
----------------
0+2 Days: 172800
+3 Days: 1086327494
104022382+3 Days: 104281582
0+3 Days: 259200
+332 Days: 1114753094
0+332 Days: 28684800
0+1 Week: 604800
0+4 Weeks: 2419200
0+3 Months: 7776000
0+1 Year: 31536000

Actual result:
--------------
0+2 Days: 172800
+3 Days: 1086327494
104022382+3 Days: 104281582
0+3 Days: -1
+332 Days: 1114753094
0+332 Days: -1
0+1 Week: -1
0+4 Weeks: -1
0+3 Months: 7776000
0+1 Year: 31536000


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


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

Reply via email to