svn: /phpdoc/en/trunk/reference/datetime/functions/ strtotime.xml

From: Date: Mon, 21 Nov 2011 17:10:22 +0000
Subject: svn: /phpdoc/en/trunk/reference/datetime/functions/ strtotime.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9060@lists.php.net to get a copy of this message
danielc Mon, 21 Nov 2011 17:10:22 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=319642 Log: Clarify time zone situation and specify that add/sub/modify are better for math (closes bug #60212). Bug: https://bugs.php.net/60212 (Open) Unexpected behaviour while adding or subtracting relative time with strtotime Changed paths: U phpdoc/en/trunk/reference/datetime/functions/strtotime.xml Modified: phpdoc/en/trunk/reference/datetime/functions/strtotime.xml =================================================================== --- phpdoc/en/trunk/reference/datetime/functions/strtotime.xml 2011-11-21 16:33:49 UTC (rev 319641) +++ phpdoc/en/trunk/reference/datetime/functions/strtotime.xml 2011-11-21 17:10:22 UTC (rev 319642) @@ -21,11 +21,11 @@ <parameter>now</parameter> is not supplied. </simpara> <para> - This function will use the <envar>TZ</envar> environment variable (if - available) to calculate the timestamp. Since PHP 5.1.0 there are easier - ways to define the timezone that is used across all date/time functions. - That process is explained in the - <function>date_default_timezone_get</function> function page. + Each parameter of this function uses the default time zone unless a + time zone is specified in that parameter. Be careful not to use + different time zones in each parameter unless that is intended. + See <function>date_default_timezone_get</function> on the various + ways to define the default time zone. </para> </refsect1> @@ -219,6 +219,14 @@ <methodname>DateTime::createFromFormat</methodname> when possible. </para> </note> + <note> + <para> + Using this function for mathematical operations is not advisable. + It is better to use <methodname>DateTime::add</methodname> and + <methodname>DateTime::sub</methodname> in PHP 5.3 and later, or + <methodname>DateTime::modify</methodname> in PHP 5.2. + </para> + </note> </refsect1> <refsect1 role="seealso">

« previous php.doc.cvs (#9060) next »