01354: ftime broken on PmWiki

Summary: ftime broken on PmWiki
Created: 2014-10-19 02:28
Status: Closed
Category: Bug
From: simon
Assigned:
Priority: 4
Version: 2.2.68
OS:

Description: ftime appears to be broken on PmWiki.

was Between 2.2.65 (PHP Version 5.3.10) and 2.2.68 the ftime markup expression above was broken
* {(ftime fmt="%b %#d %Y" when="second wed of Jan")}
* {(ftime fmt="%b %e  %Y" when="second wed of Feb")}
* {(ftime fmt="%b %e  %Y" when="second wed of Nov")}
* {(ftime fmt="%b %e  %Y" when="second wed of Dec")}
* {(ftime fmt="%b %e  %Y" when="first sat of July 2008")}
  • Jan 09 2019
  • Feb 13 2019
  • Nov 13 2019
  • Dec 11 2019
  • Jul 5 2008

See also Test.Ftime

simon October 19, 2014, at 02:29 AM

The PHP function strtotime() has had various changes since PHP 5.0 so some of the expressions that didn't work before may work now, or vice-versa. PmWiki uses as a date whatever this function recognizes and returns. If some of the expressions don't work for you, please try writing them differently, see the strtotime() manual and Date and time formats (read the notes). --Petko October 19, 2014, at 06:25 AM

Thanks, on my windows machine[1] (PHP Version 5.4.24) it works fine (after changing from %e to %#d). I wonder why PmWiki is having a problem. The documentation clearly gives an example of "first sat of July 2008". simon October 20, 2014, at 04:18 AM

In what way do you consider this a PmWiki bug? This is clearly a PHP bug (or a not-yet-implemented PHP feature) for the specific Linux version installed on this server for the specific date format you try. Not all ftime formats are broken. This bug may or may not have been fixed in more recent PHP versions, or the feature may or may not have been implemented (the documentation is about the very latest PHP release), when we upgrade the PHP version, we'll see. Other than that, there is not much I can do with the PmWiki code to fix a PHP bug. If you absolutely have to write "first sat of July 2008" on a PHP installation unable to parse it, write simply "July 5, 2008". --Petko October 22, 2014, at 06:39 AM

My misunderstanding, sorry. Thanks Petko. simon October 23, 2014, at 02:31 AM