Skip to main content

mod_dptools: strftime_tz


Displays the current time in the specified timezone, in various formats. See also mod_dptools#strftime.


strftime_tz [timezone [format_string]]

Returns the system time in the timezone specified. If the timezone is not specified, it defaults to GMT.

If format_string is not specified, it defaults to "%Y-%m-%d %T", eg. 2010-04-28 17:47:29

A list of timezones can be found in autoload_configs/timezones.conf.xml


Match Monday through Friday 8:00am to 6:30pm Pacific Time:

 <extension name="Los_Angeles_Business_Hours">
<condition field="${strftime_tz(America/Los_Angeles %u)}" expression="^[1-5]$"/>
<condition field="${strftime_tz(America/Los_Angeles %H%M)}" expression="^(0[8-9]\d{2}|1[0-7]\d{2}|18[0-2]\d)$">
<action application="log" data="INFO Business Hours"/>
<anti-action application="log" data="INFO After Hours"/>