ID: 21646 Updated by: [EMAIL PROTECTED] Reported By: wolfandreas at yahoo dot de Status: Open -Bug Type: Feature/Change Request +Bug Type: Documentation problem Operating System: all PHP Version: 4.3.0 New Comment:
Please do not use "all" for the OS field unless you know for certain that it affects all platforms equally. Most of the datetime related functions (strftime included) are dependent on what support exists in the libraries on the running system. An example of this variable behavior is the time() function which returns values from -2147483648 to 2147483647 on most unix platforms, but only returns positive values under windows. On your platform, strftime() only accepts positive values. That is not to say that strftime only accepts positive values on all platforms. Have you tried date()? The strftime manual page already has a warning stating that not all format specifiers are supported on all platforms, perhaps that should be extended to warn of inconsistent support for timestamp values. Previous Comments: ------------------------------------------------------------------------ [2003-01-14 23:16:48] wolfandreas at yahoo dot de Situation: The function strftime does return false for negative unix-timestamps. Problem: The functions mktime and strtotime return negative values for dates before 1970-01-01 00:00 UT. Many users try something like: strftime($format,strtotime($date_before_1970)) and wonder why this does not work. If the behavior for timestamps before second 0 (start of Jan 1., 1970 UT) is undefined why do all other time functions return negative values ? The documentation for strftime does not say anything about negative values for timestamps, too. Solution: Let strftime return values (Gregorian calendar) for negative timestamps. (Perhaps there should be a warning ?) ------------------------------------------------------------------------ [2003-01-14 23:13:46] wolfandreas at yahoo dot de Situation: The function strftime does return false for negative unix-timestamps. Problem: The functions mktime and strtotime return negative values for dates before 1970-01-01 00:00 UT. Many users try something like: strftime($format,strtotime($date_before_1970)) and wonder why this does not work. If the behavior for timestamps before second 0 (start of Jan 1., 1970 UT) is undefined why do all other time functions return negative values ? The documentation for strftime does not say anything about negative values for timestamps, too. Solution: Let strftime return values (Gregorian calendar) for negative timestamps. (Perhaps there should be a warning ?) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21646&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php