[OpenSIPS-Users] ?BUG? - CFGUTILS $time() PV doesn't work Opensips 1.6
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Sat Oct 24 18:57:03 CEST 2009
Hi,
you are misusing the variable.
According to the docs:
"new PV $time(format) to print time is dynamic formatted time
string. Format: see "man strftime" ; Ex: $time(B %Y) -> Thursday
September 2009"
So, you should do $time(%Y) to get the current year.
Regards,
Bogdan
osiris123d wrote:
> This is my first time trying to use the $test function. When I read the
> documentation on it I am expecting the function to return the current unit
> of time that I put in the parentheses. Yet in my config I have the
> following command just so I can test it
>
> xlog("L_INFO", "$time(year)/$time(mon)/$time(mday)
> $time(hour):$time(min):$time(sec).$time(msec)");
> The output for this is the following
> year/mon/mday hour:min:sec.msec
>
> That doesn't seem right.
>
> Also when I try the documents example
>
> if ($time(year) == "2009") {
> xlog("request: $rm from $fu to $ru in year 2009\n");
> }
>
> The condition is never true because $time(year) really equals "year"
>
More information about the Users
mailing list