STRPTIME(DatumZeit
|Zeitzone
|Format
)
; Datum/Zeit im Format "JJJJ-MM-TT HH:MM:SS" in ${zeit} speichern: exten => 123,1,Set(zeit=${STRFTIME(${EPOCH},Europe/Berlin,%Y-%m-%d %H:%M:%S)}) ; ${zeit} wieder in einen Timestamp umwandeln: exten => 123,n,Set(timestamp=${STRPTIME(${zeit}|Europe/Berlin|%Y-%m-%d %H:%M:%S)}
| | | 1.4 |————————| 1.6 |————————
-= Info about function 'STRPTIME' =-
[Syntax]
STRPTIME(<datetime>|<timezone>|<format>)
[Synopsis]
Returns the epoch of the arbitrary date/time string structured as described in the format.
[Description]
This is useful for converting a date into an EPOCH time, possibly to pass to
an application like SayUnixTime or to calculate the difference between two
date strings.
Example:
${STRPTIME(2006-03-01 07:30:35|America/Chicago|%%%%Y-%%%%m-%%%%d %%%%H:%%%%M:%%%%S)} returns 1141219835
--- in Asterisk 1.4
+++ in Asterisk 1.6
@@ -1,7 +1,7 @@
-= Info about function 'STRPTIME' =-
[Syntax]
- STRPTIME(<datetime>|<timezone>|<format>)
+ STRPTIME(<datetime>,<timezone>,<format>)
[Synopsis]
Returns the epoch of the arbitrary date/time string structured as described in the format.
@@ -12,4 +12,4 @@
date strings.
Example:
- ${STRPTIME(2006-03-01 07:30:35|America/Chicago|%%%%Y-%%%%m-%%%%d %%%%H:%%%%M:%%%%S)} returns 1141219835
+ ${STRPTIME(2006-03-01 07:30:35,America/Chicago,%%%%Y-%%%%m-%%%%d %%%%H:%%%%M:%%%%S)} returns 1141219835
STRFTIME()
“