Bug #68195 [NEW]: Issue with day number / name in a week
| From: | sandro dot casa at gmail dot com | Date: | Thu, 09 Oct 2014 07:55:07 +0000 |
| Subject: | Bug #68195 [NEW]: Issue with day number / name in a week | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187972@lists.php.net to get a copy of this message | ||
From: sandro dot casa at gmail dot com
Operating system: Windows NT SCA 6.1 build 7601 (W
PHP version: Irrelevant
Package: Calendar related
Bug Type: Bug
Bug description:Issue with day number / name in a week
Description:
------------
---
From manual page: http://www.php.net/function.date
---
l (lowercase 'L'): A full textual representation of the day of the
week Sunday through Saturday
N ISO-8601: numeric representation of the day of the week (added in PHP
5.1.0) 1 (for Monday) through 7 (for Sunday)
My PHP version is 5.5.6
Test script:
---------------
// My PHP version is 5.5.6
$date = '1900-01-01';
echo date('N', strtotime($date)); // ==> 4
echo date('l', strtotime($date)); // ==> Thurday
The thing is the 1st of Jan 1900 was a Monday...
Expected result:
----------------
$date = '1900-01-01';
echo date('N', strtotime($date)); // ==> 1
echo date('l', strtotime($date)); // ==> Monday
--
Edit bug report at https://bugs.php.net/bug.php?id=68195&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68195&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68195&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68195&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68195&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68195&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68195&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68195&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68195&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68195&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68195&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68195&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68195&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68195&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68195&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68195&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68195&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68195&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68195&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68195&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68195&r=mysqlcfg