Misc. Dialplan Tools strftime tz

From FreeSWITCH Wiki
Revision as of 22:45, 7 April 2011 by Maxclark (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Displays the current time in the specified timezone, in various formats.


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"/>

See Also