[pmwiki-users] Amending ctime from Within PmWiki

Martin Spindler spindler at isg.cs.uni-magdeburg.de
Tue Aug 28 05:15:31 CDT 2007


Hi Pm and list,

On 2006-07-20 Patrick R. Michaud wrote:
> It's easy to add ctime to ?action=attr, the hard part is having
> something that can convert dates and times into unix timestamps.
> (Especially since whatever we use needs to be re-usable for many
> date+time conversions in PmWiki, not just this one application.)
>
> To just add ctime to ?action=attr:
>
>     $PageAttributes['ctime'] = '$[Set page creation time:]';
>
> This at least allows a person to enter a new timestamp, but
> it doesn't handle conversions well (I'm still thinking about
> that issue).  One simplistic way to do that might be to do the
> following in local/config.php or a recipe:
>
>     if (@$_POST['ctime']) { ...code to convert ctime here... }
>   
This works quite good for me.

How can I format the input/output to something like "2007-07-17 18:32:01"?
(Both directions are required.)

Could you provide a small example for "...code to convert ctime here..."?

Thanks,
Martin.







More information about the pmwiki-users mailing list