#21646 [NEW]: Strftime: negative timestamps
| From: | wolfandreas at yahoo dot de | Date: | Wed, 15 Jan 2003 05:13:46 +0000 |
| Subject: | #21646 [NEW]: Strftime: negative timestamps | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-30058@lists.php.net to get a copy of this message | ||
From: wolfandreas@yahoo.de
Operating system: all
PHP version: 4.3.0
PHP Bug Type: Feature/Change Request
Bug description: Strftime: negative timestamps
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 bug report at http://bugs.php.net/?id=21646&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21646&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21646&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21646&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21646&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21646&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21646&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21646&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21646&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21646&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21646&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21646&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21646&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21646&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21646&r=gnused