Bug #67960 [NEW]: Long/short day names reversed in jddayofweek()

From: Date: Thu, 04 Sep 2014 13:34:08 +0000
Subject: Bug #67960 [NEW]: Long/short day names reversed in jddayofweek()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187411@lists.php.net to get a copy of this message
From: fisharebest at gmail dot com Operating system: All PHP version: 5.6.0 Package: Calendar related Bug Type: Bug Bug description:Long/short day names reversed in jddayofweek() Description: ------------ --- From manual page: http://www.php.net/function.jddayofweek --- The $mode parameter is an integer (0, 1 or 2) for which predefined constants are also available. Numeric parameters work as per the documentation: 0 = numeric 1 = long name 2 = short name But if the constants CAL_DOW_LONG and CAL_DOW_SHORT are used, the wrong results are returned. CAL_DOW_LONG gives the short name and CAL_DOW_SHORT gives the long name. The bug is present in all versions of PHP from 5.3 through 5.6. Test script: --------------- print_r(jddayofweek(1234567, 1)); // "Saturday" print_r(jddayofweek(1234567, CAL_DOW_LONG)); // "Sat" (WRONG) print_r(CAL_DOW_LONG); // 2 print_r(jddayofweek(1234567, 2)); // "Sat" print_r(CAL_DOW_SHORT); // 1 print_r(jddayofweek(1234567, CAL_DOW_SHORT)); // "Saturday" (WRONG) -- Edit bug report at https://bugs.php.net/bug.php?id=67960&edit=1 --

« previous php.bugs (#187411) next »