|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-04-21 03:55 UTC] fs at coresec dot de
Description:
------------
When dealing with a MySQL-Datetime Tiemstamp i've encountered the following Bug which leads to an error resulting in a wrong integer (resulting days).
$mysql is an array containing a mysql datetime at point [6] "2011-06-21"
If $mysql[6] is in the future and time() is the present unix-timestamp we're getting a wrong result in $remaining (days).
Test script:
---------------
$remaining = floor(strtotime(str_replace('-','',$mysql[6])) - time()/(60*60*24));
Expected result:
----------------
29
Actual result:
--------------
1305920914
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
OMFG! I'm so sorry about this - pretty late here in Germany :( It was absolutely my fault as i didnt set the brakets correctly. $remaining = floor((strtotime(str_replace('-','',$proxy[6])) - time())/(60*60*24)); Works as aspected - i am sorry for this bugreport - should have triple-checked it before posting it. Have a sunny weekend guys!