Fixed bug #45847 strftime() (returns an empty string when using the %e conversion specifier)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@304637 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2010-10-23 05:59:00 +00:00
parent 22c05e49ca
commit 17ece6f8ff

View file

@ -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 @@ echo strftime(" in German %A.\n");
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>ISO 8601:1988 week number example</title>
<programlisting role="php">
@ -434,6 +447,28 @@ echo "1/2/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/2/2005")) . "\n
// Outputs: 1/3/2005 - %V,%G,%Y = 1,2005,2005
echo "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2005")) . "\n";
?>
]]>
</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>