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

SteP step.list+pmwiki at gmail.com
Tue Oct 30 10:26:46 CDT 2007


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. One way (kludge?) to work around this issue is to extend ftime to 'normalize' PmWiki time 
variables before they are expanded. So, for instance, {(ftime "{$LastModified}" fmt="whatever")}, would 
be roughly equivalent to these steps

$save=$TimeFmt
$TimeFmt="%Y%M%D %I:%M" // a 'normalized', locale-independent format
expand {$LastModified}  => "yyyymmdd hh:mm"
$TimeFmt=$save
parse "yyyymmdd hh:mm" and format it according to "whatever"  

sti at pooq.com wrote:

> SteP wrote:
>> I think your recipe is what I was looking for, but I'm getting
>> strange results. I'm using it in a pagelist template, switching
>> language from English to another language. Everything works as
>> expected, when English is the language, but when the other language
>> is used when="{=LastModified}" returns the current datetime for
>> almost all pages. The only page for which the correct modification
>> time is returned is an older page, as if PmWiki's lastmodified
>> internal storage format had changed at some point in an incompatible
>> way.  Here' the template, if you kindly could give it a shot 
>> 
> I'm afraid I don't see anything wrong in that template that could
> explain that strange behavior. It looks like sometimes the date being
> passed in is somehow blank, and the code is using the the current date
> instead. But for that to happen, then {=$LastModified} would have to
> be returning nothing at all, and I can't think what would cause that.
> 





More information about the pmwiki-users mailing list