#26793 [NEW]: strtotime() additions

From: Date: Mon, 05 Jan 2004 13:22:29 +0000
Subject: #26793 [NEW]: strtotime() additions
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969357944@lists.php.net to get a copy of this message
From: kulakov74 at yandex dot ru Operating system: PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: strtotime() additions Description: ------------ I think strtotime() and probably the more general "Date and Time Functions" chapter need these additions: 1. Daylight Savings Time stuff should be explained; it should be clearly stated that one can't do integer arithmetics right with timestamps because of DST. At least strtotime() handles this correctly (another option is maketime()), so it should be used whenever, say, we need to add 7 days to a date as in strtotime('+7 days', $Date), while this is wrong: $Date+=7*24*3600. This will prevent a lot of developers new to the date&time issue from stumbling over the problem and reporting another "bug" answered with a congratulation on DST discovery. 2. Descriptions of all the formats for the "time" parameter in strtotime() should be included in the PHP documentation itself; providing just a link to GNU Tar Date formats does not necessarily leads to following the link and therefore leads to misunderstanding of the "time" parameter formats, hence to another wave of "bug" reports about "next [weekday]" unexpected behavour. Reproduce code: --------------- Current (online) strtotime() documentation Expected result: ---------------- I think people should be able to know what strtotime() will return and avoid the described pitfalls when they have read the PHP docs alone -- Edit bug report at http://bugs.php.net/?id=26793&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26793&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26793&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26793&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26793&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26793&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26793&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26793&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26793&r=support Expected behavior: http://bugs.php.net/fix.php?id=26793&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26793&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26793&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26793&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26793&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26793&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26793&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26793&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26793&r=float

« previous php.doc (#969357944) next »