Use Event-Timestamp for Accounting Start/Stop with MySQL

Juri Glaß at
Mon Dec 20 17:46:39 CET 2010

Am 20.12.2010 um 14:33 schrieb Juri Glaß:

> I would like to write the Event-Timestamp from Accounting Start/Stop messages to my MySQL database instead of the server side time.
> I tried to configure the dialup.conf, but it doesn't work properly.
> I replaced %S with %{Event-Timestamp}, the result is "0000-00-00 00:00:00" in the database, the log file says :
> expand:  UPDATE radacct SET acctstoptime = '%{Event-Timestamp}',   ** snip **  -> UPDATE radacct SET acctstoptime = 'Dec 21 2010 10:02:30 CET'  ** snip **
> When I use something like DATE_FORMAT(date,format) from MySQL, the format string is somehow expanded. FROM_UNIXTIME isn't working either.
> I understand that unix timestamps are printed as strings like 'Dec 21 2010 10:02:30 CET', but only for logging or for the sql statements too?

I solved this by changing the strftime format string in print.c 
If someone has a better solution, I would appreciate an answer.

More information about the Freeradius-Users mailing list