BoltWire is a FREE content management system written in PHP.

Its innovative architecture combined with best-in-class forms processing makes it ideal for creating complex, interactive, web applications fast...




Handbook > Conditions > Time

The time conditional can be used to tell whether a time value time falls within a specified range.

Normally the time checked is the current time, but you can specify your own timestamp or any time expression that is recognized by PHP's strtotime function.

The "before" parameter and "after" parameter can also both take a timestamp or a time expression. If both parameters are supplied the checked time must pass both tests. If you only give one, it only needs to pass that test.

For example:

[if time after='April 16']Taxes are late[else]Taxes due soon[if]

This shows one message April 16 or later, the other if it is before April 16. (PHP assumes the current year with an expression like this).

Here's another example:

[if time before='01/01/2015']Exciting new content--coming soon[else]Exciting new content--available now[if]

If the current date is before 1/1/15, the see the "coming soon" announcement. On the the due date, the content automatically becomes available.

Note: before is equivalent to ! after and vice versa.

Here's a third example. Suppose you had stored your users birth date in their profile and you want to only show content to users that are more than 20 years old:

[if time '{~birthdate}' after='30 years ago' before='20 years ago']Between 20 and 30[else]Too old or young[if]
tags: conditions time ~