[pmwiki-users] calculation with time

Peter & Melodye Bowers pbowers at pobox.com
Thu Jun 5 03:11:22 CDT 2008


If you are talking about in the underlying PHP:

>     if "current time" < "current time"-"two weeks"

If (time() < (time() - (2 * 7 * 24 * 60 * 60)))

>     if "current time" < "current time"-"two hours"

If (time() < (time() - (2 * 60 * 60)))

>     if "current time" < "current time"-"two minutes

If (time() < (time() - (2 * 60)))

Obviously none of these will ever be true since you've specified "current
time" as both sides of the comparison, but I'm assuming that the left side
of the comparison will be some value that you will store in a variable or
something.

Seems like strftime('%u') would give similar capabilities but maybe not on
all platforms (this is available via MarkupExpression if you are doing this
within markup instead of at the PHP level)?  

-Peter




More information about the pmwiki-users mailing list