Doc #45847 [Com]: strftime() returns an empty string when using the %e conversion specifier

From: Date: Wed, 29 Sep 2010 17:05:48 +0000
Subject: Doc #45847 [Com]: strftime() returns an empty string when using the %e conversion specifier
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5147@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=45847&edit=1 ID: 45847 Comment by: contact at juliencrouzet dot fr Reported by: vincent at vent dot be Summary: strftime() returns an empty string when using the %e conversion specifier Status: Open Type: Documentation Problem Package: Date/time related Operating System: win32 only PHP Version: 5.2.6 Block user comment: N New Comment: Again, I think the simple way would be to replace "%e" by "%#d" IN THE C SOURCE (if on Windows) Previous Comments: ------------------------------------------------------------------------ [2010-09-29 10:51:05] martijn dot niji at gmail dot com Can't we (or rather you) fix this by adding a nice entry in PHP docs and making it so %e gets accepted but returns the same as %d or even %#d? Especially since this has been open since 2008? By the way, this is still an issue on PHP 5.3 ------------------------------------------------------------------------ [2010-09-16 17:46:10] matt at ssradio dot com You could perhaps use the following test to avoid running into this problem: if (stristr(php_uname('s'), 'WIN')) { // Are we running under Windows? // %e conversion specifier not supported, use %#d instead } else { // OK to use %e } Hope that helps! ------------------------------------------------------------------------ [2010-07-31 07:12:10] contact dot php at juliencrouzet dot fr Wouldn't it be nice to replace "%e" by "%#d" php_strftime ? (conditionally) ------------------------------------------------------------------------ [2010-05-05 13:47:08] cyrille37 at gmail dot fr strftime() is not portable, so for Win32 have a look at http://msdn.microsoft.com/en-us/library/fe06s4ak%28VS.71%29.aspx You could not find %e but ... there is the formater char "#" that can Remove leading zeros (if any). Replace "%e" by "%#d", it's work ! Cyrille. ------------------------------------------------------------------------ [2008-08-17 22:56:50] pajoye@php.net %e is not supported on Windows. strftime PHP's implementation is not portable. Assigned to the maintainer, if he likes to comment more or make it portable. See: http://msdn.microsoft.com/en-us/library/fe06s4ak(VS.71).aspx for the list of supported identifiers. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=45847 -- Edit this bug report at http://bugs.php.net/bug.php?id=45847&edit=1

« previous php.doc.bugs (#5147) next »