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

From: Date: Sat, 23 Oct 2010 05:59:00 +0000
Subject: svn: /phpdoc/en/trunk/reference/datetime/functions/ strftime.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-7298@lists.php.net to get a copy of this message
kalle Sat, 23 Oct 2010 05:59:00 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=304637 Log: Fixed bug #45847 strftime() (returns an empty string when using the %e conversion specifier) Bug: http://bugs.php.net/45847 (Open) strftime() returns an empty string when using the %e conversion specifier Changed paths: U phpdoc/en/trunk/reference/datetime/functions/strftime.xml Modified: phpdoc/en/trunk/reference/datetime/functions/strftime.xml =================================================================== --- phpdoc/en/trunk/reference/datetime/functions/strftime.xml 2010-10-23 05:30:55 UTC (rev 304636) +++ phpdoc/en/trunk/reference/datetime/functions/strftime.xml 2010-10-23 05:59:00 UTC (rev 304637) @@ -73,7 +73,10 @@ </row> <row> <entry><literal>%e</literal></entry> - <entry>Day of the month, with a space preceding single digits</entry> + <entry> + Day of the month, with a space preceding single digits. Not + implemented as described on Windows. See below for more information. + </entry> <entry><literal> 1</literal> to <literal>31</literal></entry> </row> <row> @@ -309,6 +312,14 @@ As a result, %u may not function as described in this manual. </simpara> </warning> + <warning> + <simpara> + <emphasis>Windows only:</emphasis> The <literal>%e</literal> modifier + is not supported in the Windows implementation of this function. To achieve + this value the <literal>%#d</literal> modifier can be used instead. Below + example will illustrate how to write a cross platform compatible function. + </simpara> + </warning> </listitem> </varlistentry> @@ -385,6 +396,8 @@ ]]> </programlisting> </example> + </para> + <para> <example> <title>ISO 8601:1988 week number example</title> <programlisting role="php"> @@ -439,6 +452,28 @@ </programlisting> </example> </para> + <para> + <example> + <title>Cross platform compatible example using the %e modifier</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$format = '%e': + +// Check for Windows and only attempt to replace +// the %e modifiers if they exists in the format +if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && strpos($format, '%e') !== false) +{ + $format = str_replace('%e', '%#d', $format); +} + +echo strftime($format); +?> +]]> + </programlisting> + </example> + </para> </refsect1> <refsect1 role="notes">

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