Wikka : TimeWithOffset

HomePage :: Categories :: Index :: Changes :: Comments :: Documentation :: Blog :: Login/Register

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
/*
        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
There are no comments on this page. [Add comment]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.1308 seconds