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;
}

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to