Thanks for your guidance. Indeed, it is much more interesting to store dates with a format easy to read!<br>Yet, I still have some difficulties. Here is the value of the variable ActionDeadline:<br>(:ActionDeadline: 20080230T1600+0100:)
<br><br>If I try to display this date with the ftime markup:<br>* Date: {(ftime %D {$:ActionDeadline})}<br><br>I get:<br>* Date: 01/01/70<br><br>What is the problem?<br><br><br><div><span class="gmail_quote">2007/6/17, Patrick R. Michaud <
<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Sun, Jun 17, 2007 at 03:08:51PM -0400, The Editor wrote:
<br>> On 6/17/07, Patrick R. Michaud <<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>> wrote:<br>> >On Sun, Jun 17, 2007 at 08:55:55AM -0400, The Editor wrote:<br>> >><br>> >> I still don't like all the changes Pm made to the time function,
<br>> >> specifically to require the @ symbol, but that's how it works in<br>> >> PmWiki.<br>> ><br>> >I felt this was important so that we could reliably distinguish<br>> >ISO dates (20070617) from UNIX timestamps (@20070617).
<br>><br>> Perhaps the problem has<br>> to do with the lack of documentation. Not sure where to put it though<br>> as it's not really a ZAP function any longer.<br><br>Since ZAP is providing the interface to strtotime(), I think that's
<br>probably a good place to mention the use of @ when using the results<br>of strtotime with {(ftime)}.<br><br>PmWiki itself doesn't expose timestamps to authors, but instead tries<br>to stick with ISO formats (which have the advantage of being readable
<br>and meaningful to most authors).<br><br>And, of course, {(ftime)} will accept any format that strtotime()<br>accepts, so instead of calling strtotime in the zap form and<br>storing the result, one could instead just store the human-readable
<br>value directly, and avoid the conversion to a timestamp altogether.<br>Thus, instead of:<br><br>> (:zapform key=AddEvent:)<br>> (:input text EventYear:)<br>> (:zap php_EventDate="strtotime|{EventYear}" AddEvent:)
<br>> (:zap EventDate="{php_EventDate}" AddEvent:)<br>> (:zap savedata="EventDate" AddEvent:)<br>> (:input submit:)<br>> (:zapend:)<br>><br>> {(ftime %Y when="{$:EventDate}":)
<br><br>I would think that one could more easily do something like:<br><br> (:zapform key=AddEvent:)<br> (:input text EventYear:)<br> (:zap EventDate="{EventYear}" AddEvent:)<br> (:zap savedata="EventDate" AddEvent:)
<br> (:input submit:)<br> (:zapend:)<br><br> {(ftime %Y when="{$:EventDate}":)<br><br>In fact, it seems that one could just save EventYear directly<br>to the page, and use it directly:<br><br> {(ftime %Y when="{$:EventYear}":)
<br><br>Pm<br></blockquote></div><br>