STRPTIME Not Working?

Hello,

I am trying to implement a calendar integration that plays back the summaries and descriptions of calendar events for a selected day (today, tomorrow, etc.). I need to find the “end of today” in linux time to set up the calendar query time interval. The second line below is not returning today, 12:59:59 PM in linux time as expected. Instead, it is returning 0 in CLI. The first line returns the correct value. I can’t figure out why, the syntax looks correct to me.

extensions_custom.conf

[from-internal-custom]


exten => 795,n,Set(DayEnd=${STRFTIME(${EPOCH},%Y-%m-%d 23:59:59)})
exten => 795,n,Set(EpochDayEnd=${STRPTIME(${DayEnd},%Y-%m-%d %H:%M:%S)})

CLI> core show functions
shows 181 custom functions installed. STRFTIME and STRPTIME are included which I presume mean they are loaded.

Does anyone know of a fix or work-around for this problem?

Incredible PBX: 13.0.195.28
Asterisk: 13.22.0
Ubuntu: 18.04

The EPOCH is granular to seconds (strftime) but internal asterisk’ time functions only to minutes (Like gotoiftime, strptime) so it ‘rounds-up’

Edit, i would be curious to know whether the rounding is on the minute or at 30 seconds passed, my guess, the minute

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.