#38481 [NEW]: strtotime return invalid timestamp (if input value is timestamp)

2006-08-17 Thread oleg at programstar dot com
From: oleg at programstar dot com
Operating system: Fedora 4.1
PHP version:  5.1.4
PHP Bug Type: Date/time related
Bug description:  strtotime return invalid timestamp (if input value is 
timestamp)

Description:

I#8217;ve found a bug in strtotime() function.
The present function does not return anything if you transmit
unix_timestamp as a function parameter. However, if the last four digits
of the value compose a valid year value, the function tries to calculate
the whole date with the last 5 digits. Probably it fails there so it
returns unix_timestamp the dates with the day and month equal to the
current one, as far as the year goes, it is the one that the function has
detected in the timestamp primary value. 

Example: 
Primary value: 1136412001 (January, 5, 2006)
On return: 998037401 (August, 17, 2001)

This way, a standard plug-in Smarty uses this function to transform the
UNIX_TIMESTAMP format data into any data value. 
PHP Version 5.1.4

Original here: http://hcjack.livejournal.com/322438.html (on russian)


-- 
Edit bug report at http://bugs.php.net/?id=38481edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38481r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38481r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38481r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38481r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=38481r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=38481r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=38481r=needscript
Try newer version:http://bugs.php.net/fix.php?id=38481r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=38481r=support
Expected behavior:http://bugs.php.net/fix.php?id=38481r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=38481r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=38481r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38481r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38481r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38481r=dst
IIS Stability:http://bugs.php.net/fix.php?id=38481r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=38481r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38481r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=38481r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=38481r=mysqlcfg


#38481 [Bgs]: strtotime return invalid timestamp (if input value is timestamp)

2006-08-17 Thread oleg at programstar dot com
 ID:   38481
 User updated by:  oleg at programstar dot com
 Reported By:  oleg at programstar dot com
 Status:   Bogus
 Bug Type: Date/time related
 Operating System: Fedora 4.1
 PHP Version:  5.1.4
 New Comment:

Yes, certainly! But repetition - thereby function uses standart
function date_format in Smarty.
Sorry for my bad English


Previous Comments:


[2006-08-17 11:21:13] [EMAIL PROTECTED]

Actually, no need to try the snapshot, it's bogus.
The function was never intended to parse timestamps, it parses string
containing a US English date format.



[2006-08-17 11:04:04] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

If you're still able to reproduce it - please provide short and
complete reproduce script.



[2006-08-17 11:01:33] oleg at programstar dot com

Description:

I#8217;ve found a bug in strtotime() function.
The present function does not return anything if you transmit
unix_timestamp as a function parameter. However, if the last four
digits of the value compose a valid year value, the function tries to
calculate the whole date with the last 5 digits. Probably it fails
there so it returns unix_timestamp the dates with the day and month
equal to the current one, as far as the year goes, it is the one that
the function has detected in the timestamp primary value. 

Example: 
Primary value: 1136412001 (January, 5, 2006)
On return: 998037401 (August, 17, 2001)

This way, a standard plug-in Smarty uses this function to transform the
UNIX_TIMESTAMP format data into any data value. 
PHP Version 5.1.4

Original here: http://hcjack.livejournal.com/322438.html (on russian)






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