[pmwiki-users] get page modification time in English, how?

sti at pooq.com sti at pooq.com
Tue Oct 30 14:51:01 CDT 2007


SteP wrote:
> I suspect there's a design issue using ftime and PmWiki time variables
> together. $LastModified is formatted according to $TimeFmt, but ftime
> doesn't take $TimeFmt into consideration when parsing its <when> parameter.
> So it's very possible to set $TimeFmt to a format that ftime can't parse at
> all.

Actually, now that you mention it, that sounds very likely. Rather than
playing with $TimeFmt and trying to get ftime to do its own variable expansion
(which could get messy), its probably easier to just create a new variable
that holds the same value as $LastModified in some known format. I'd recommend
a unix timestamp for that, so you'd create a PV like:

  $FmtPV['$PageTime'] = '$page["time"]';

ftime can parse a unix timestamp if it starts with '@', so you'd change your
template to have entries like:

  {(ftime fmt="whatever" when=@{$PageTime} lc="en")}

and it should work. (although I haven't tested it.)





More information about the pmwiki-users mailing list