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 &lt;
<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>&gt;:</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>&gt; On 6/17/07, Patrick R. Michaud &lt;<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>&gt; wrote:<br>&gt; &gt;On Sun, Jun 17, 2007 at 08:55:55AM -0400, The Editor wrote:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; I still don&#39;t like all the changes Pm made to the time function,
<br>&gt; &gt;&gt; specifically to require the @ symbol, but that&#39;s how it works in<br>&gt; &gt;&gt; PmWiki.<br>&gt; &gt;<br>&gt; &gt;I felt this was important so that we could reliably distinguish<br>&gt; &gt;ISO dates (20070617) from UNIX timestamps (@20070617).
<br>&gt;<br>&gt; Perhaps the problem has<br>&gt; to do with the lack of documentation. Not sure where to put it though<br>&gt; as it&#39;s not really a ZAP function any longer.<br><br>Since ZAP is providing the interface to strtotime(), I think that&#39;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&#39;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>&gt;&nbsp;&nbsp;(:zapform key=AddEvent:)<br>&gt;&nbsp;&nbsp;(:input text EventYear:)<br>&gt;&nbsp;&nbsp;(:zap php_EventDate=&quot;strtotime|{EventYear}&quot; AddEvent:)
<br>&gt;&nbsp;&nbsp;(:zap EventDate=&quot;{php_EventDate}&quot; AddEvent:)<br>&gt;&nbsp;&nbsp;(:zap savedata=&quot;EventDate&quot; AddEvent:)<br>&gt;&nbsp;&nbsp;(:input submit:)<br>&gt;&nbsp;&nbsp;(:zapend:)<br>&gt;<br>&gt;&nbsp;&nbsp;{(ftime %Y when=&quot;{$:EventDate}&quot;:)
<br><br>I would think that one could more easily do something like:<br><br>&nbsp;&nbsp; (:zapform key=AddEvent:)<br>&nbsp;&nbsp; (:input text EventYear:)<br>&nbsp;&nbsp; (:zap EventDate=&quot;{EventYear}&quot; AddEvent:)<br>&nbsp;&nbsp; (:zap savedata=&quot;EventDate&quot; AddEvent:)
<br>&nbsp;&nbsp; (:input submit:)<br>&nbsp;&nbsp; (:zapend:)<br><br>&nbsp;&nbsp; {(ftime %Y when=&quot;{$:EventDate}&quot;:)<br><br>In fact, it seems that one could just save EventYear directly<br>to the page, and use it directly:<br><br>&nbsp;&nbsp; {(ftime %Y when=&quot;{$:EventYear}&quot;:)
<br><br>Pm<br></blockquote></div><br>