Wiki source for TimeWithOffset


Show raw source

=====Time With Offset Action=====

This action displays the current server time, with an optional offset. Here's the code, which should be saved as ##actions/time.php##:

%%(php) <?php
/*
time action
Displays the current time (with optional offset)
Syntax: {{time}} or {{time offset="-5"}}
*/

$offset = trim($vars['offset']);

if ($offset=="") {
echo date("h:i:s a", time());
} else {
echo date("h:i:s a", time() + (60*60*$offset));
}

?> %%

**See also:** DateWithOffset

----
CategoryUserContributions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki