By the way the time function has been revised just a small bit more. The
capital FMT didn't work (a typo). Should be lower case. I also added a
"since" parameter which will return how many days since a timestamp. I've
found that useful in several of my scripts.
function BOLTFtime($args, $zone='') {
## VERSATILE TIME FUNCTION. WHEN(#1) IS TIMESTAMP OR TEXT EXPRESSION. FMT
IS STRFTIME RECOGNIZABLE VALUE, WITH ADDITION OF %E (DAY OF MONTH, NO
LEADING 0). CAN SET A DEFAULT TIMEFMT IN SITE.CONFIG. FMT CAN ALSO BE
TIMESTAMP OR DUE (GIVES DAYS UNTIL WHEN).
global $BOLTtime;
if (isset($args['when'])) $t = BOLTfilter($args['when'], 'parameter');
else $t = $args[1];
if (! is_numeric($t) || strlen($t) != 10) $t = strtotime($t);
if ($t == '') $t = $BOLTtime;
if (isset($args['fmt'])) $f = BOLTfilter($args['fmt'], 'parameter');
else $f = $args[2];
if ($f == '') $f = BOLTconfig('timeFmt', '%c');
if ($f == 'timestamp' || $f == '%s') return $t;
if ($args['fmt'] == 'due') return round(($t - $BOLTtime)/86400);
if ($args['fmt'] == 'since') return round(($BOLTtime - $t)/86400);
if (strpos($f, '%E') !== false) $f = str_replace('%E', ltrim(strftime('%d',
$t),0), $f);
return strftime($f, $t);
}
Cheers,
Dan
On Wed, Oct 30, 2013 at 7:20 PM, jacmgr <[email protected]> wrote:
> I'll give it a shot. Thankyou Dan.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/boltwire.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/groups/opt_out.