Name
DateTime() — Says the specified time in a custom format
Synopsis
DateTime([unixtime][,timezone[,format]])
Says the time unixtime, in the time
zone specified by timezone, according to
the format specified in format.
The unixtime argument is the time, in
seconds, since January 1, 1970. It may be negative for dates before
1970. unixtime defaults to the current
time.
The timezone argument specifies the
time zone of the specified time. See
/usr/share/zoneinfo/ for a list of valid time
zones. timezone defaults to the current
time zone of the Asterisk server.
The format argument specifies which
parts of the date and time should be read. See
voicemail.conf for formatting options.
format defaults to "ABdY 'digits/at' IMp".
Returns 0, or -1 on hangup.
; today's date and time
exten => 123,1,DateTime()
; today's date
exten => 124,1,DateTime(,,BdY)
; A specified date
exten => 125,1,DateTime(871624800,,BdY)Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access