How do I get yesterday date in Freeswitch?

289 Views Asked by At

In Freeswitch dialplan, I know I can get today date using ${strftime(%Y%m%d}, but how do I get yesterday date correctly? I can do ${strftime(%Y%m)}${expr(${strftime(%d}-1)}, but what about yesterday date of Jan, 1st, 2017? Thanks for all your helps.

1

There are 1 best solutions below

0
On

var.xml

<X-PRE-PROCESS cmd="exec-set" data="yesterday=date -d 'yesterday' +'%b %d %Y'">

fs_cli

freeswitch@host> eval $${yesterday}
Nov 16 2017