ID: 21646 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open -Bug Type: Feature/Change Request +Bug Type: Date/time related Operating System: all PHP Version: 4.3.0 New Comment:
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 ?) Previous Comments: ------------------------------------------------------------------------ [2003-01-14 23:13:46] [EMAIL PROTECTED] 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