Bug #70870 [NEW]: datetime bug
| From: | samgolam at 163 dot com | Date: | Fri, 06 Nov 2015 10:52:33 +0000 |
| Subject: | Bug #70870 [NEW]: datetime bug | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-197075@lists.php.net to get a copy of this message | ||
From: samgolam at 163 dot com
Operating system: CENTOS 6.5
PHP version: 5.6.15
Package: Date/time related
Bug Type: Bug
Bug description:datetime bug
Description:
------------
date('Y-m-d H:i:s',strtotime('1986-05-04 00:00:00')) resutl equl
1986-05-04 01:00:00
$arr = array(
'1986-05-04 00:00:00',
'1987-04-12 00:00:00',
'1988-04-10 00:00:00',
'1989-04-16 00:00:00',
'1990-04-15 00:00:00',
'1991-04-14 00:00:00'
);
just 6 day
Datetime is same as this
Test script:
---------------
$arr = array(
'1986-05-04 00:00:00',
'1987-04-12 00:00:00',
'1988-04-10 00:00:00',
'1989-04-16 00:00:00',
'1990-04-15 00:00:00',
'1991-04-14 00:00:00'
);
foreach($arr as $date){
echo date('Y-m-d H:i:s',strtotime($date));
}
/**
'1986-05-04 01:00:00',
'1987-04-12 01:00:00',
'1988-04-10 01:00:00',
'1989-04-16 01:00:00',
'1990-04-15 01:00:00',
'1991-04-14 01:00:00'
**/
--
Edit bug report at https://bugs.php.net/bug.php?id=70870&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70870&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70870&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70870&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70870&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70870&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70870&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70870&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70870&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70870&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70870&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70870&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70870&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70870&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70870&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70870&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70870&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70870&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70870&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70870&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70870&r=mysqlcfg