ID:          26793
 Updated by:  [EMAIL PROTECTED]
 Reported By: kulakov74 at yandex dot ru
-Status:      Open
+Status:      Closed
 Bug Type:    Documentation problem
 PHP Version: Irrelevant
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

"Make sure to take daylight saving time into consideration (use e.g.
$date = strtotime('+7 days', $date) and not $date += 7*24*60*60)."

The link didn't work only a while and the documentation is quite
complex so I didn't integrate it.


Previous Comments:
------------------------------------------------------------------------

[2004-01-15 16:48:37] chris at free-source dot com

Also on the strtotime page the link to the GNU utils man page is dead.

------------------------------------------------------------------------

[2004-01-05 08:22:28] kulakov74 at yandex dot ru

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 this bug report at http://bugs.php.net/?id=26793&edit=1

Reply via email to