[pmwiki-users] Highlight pagelist search results based on time thresholds
Hans
design5 at softflow.co.uk
Sun Jul 13 12:53:56 CDT 2008
Sunday, July 13, 2008, 4:13:21 PM, Peter Bowers wrote:
> Yes, I banged my head against the {(ftime ...)} for an hour or more
> this morning before giving up and going the FmtPV route (which
> presumably is faster anyway). I revisited ftime just now and it
> worked first time -- I think I must have been doing something strange
> with my date formats before or something.
I had a similar frustrating time with ftime. But I found my fault!
If you want the {(ftime )} expression to take unix seconds as input,
you need to precede the value with a '@' like
{(ftime %F @{$ModTime} )}
If you want {(ftime )} output unix seconds, use '%s' as format, like
{(ftime '%s' )}
But ftime fails to evaluate input values from PmWiki default time format
'%B %d, %Y, at %I:%M %p'
{(ftime '%s' '{$LastModified}' )} outputs $Now in unix seconds
{(ftime '%s' '@{$ModTime}' )} outputs correct unix seconds
{$ModTime} is last modified time in unix seconds, as per this
definition in config.php:
$FmtPV['$ModTime'] = '$page["time"]';
~Hans
More information about the pmwiki-users
mailing list