How to get current datetime in freeradius?

Houman houmie at gmail.com
Wed Oct 2 21:17:09 CEST 2019


Hi Christian,

It works. Totally awesome thank you for all your help.

Regards
Houman

On Wed, 2 Oct 2019 at 10:39, Christian Strauf <strauf at rz.tu-clausthal.de>
wrote:

> Hi Houman,
>
> "%l" gives you POSIX time (seconds since the Unix epoch). You should be
> able to modify your query like this to make it work (make sure to test it,
> it's just off the top of my head):
>
> %{sql:SELECT UNIX_TIMESTAMP(expires_at) FROM main_db.`user` WHERE
> main_db.`user`.username ='%{User-Name}'}
>
> UNIX_TIMESTAMP should convert the date to POSIX time in seconds (unsigned
> integer).
>
> Kind regards,
> Christian Strauf
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list