[pmwiki-users] How to: calculate how many days left
Randy
randy at brownragfilms.com
Tue Feb 26 20:07:22 CST 2008
Actually, the utime function does not correctly return the number of
seconds from the unix epoch.
At 7:30 p.m. I tried this:
{(sub (utime now) (utime {MyPage$LastModified}) )}
It evaluated to over 20 hours, even though I had modified MyPage
within the previous minute or two.
I suspect utime loses precision when it calls the date function.
Is there a way to get the actual number of seconds?
Randy
On Feb 26, 2008, at 5:08 AM, Hans wrote:
> The following markup expression will give a unix timestamp
> (seconds from the unix epoch 1-Jan-1970 00:00 UTC)
>
> # unix time, seconds since 1970-01-01
> $MarkupExpr['utime'] = 'MxUTime($args[0])';
> function MxUTime($arg) {
> $udate = date('U', strtotime($arg));
> if ($arg=='now') $udate = time();
> return $udate;
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20080226/1907735b/attachment.html
More information about the pmwiki-users
mailing list