[pmwiki-users] making page variables (was: Re: tweaking the operation of Site.AuthForm)
Neil Herber
nospam at eton.ca
Wed Mar 22 19:21:20 CST 2006
At 2006-03-22 10:06 PM +0000, Hans is rumored to have said:
> > I want to write: It was (:time:) in Ottawa when you requested this
> > page. Refresh the page to see the current time.
>
>Well there isn't, but we can easily create one:
>
># adds pagevariable {$Time} of format HH:MM:SS, 24 hour clock.
>$FmtPV['$Time'] = 'strftime("%H:%M:%S", time() )';
>
>If you want a different format change it inside the strftime function,
>see http://uk.php.net/strftime
Once again, thanks Hans!
I eventually put this in farmconfig:
# Create a page variable called Now
$FmtPV['$Now'] = 'strftime("%A, %I:%M %p", time() )';
such that {$Now} displays as Wednesday, 08:12 PM .
The day was important because I have people I am dealing with in
Singapore and New Zealand and it is often tomorrow when I talk to
them, though they think I am living in yesterday. Gets quite
confusing near weekends.
This page variable thing could be addictive.
Neil
Neil Herber
Corporate info at http://www.eton.ca/
Eton Systems, 15 Pinepoint Drive, Nepean, ON, Canada K2H 6B1
Tel: (613) 829-4668
More information about the pmwiki-users
mailing list