Having a consistent Event-Timestamp format
Hi All, I'm using the 'Event-Timestamp' in the python module it's printed as follows. *Oct 12 2016 13:59:27 UTC* However the timestamp format present in the MySQL databse is *2006-01-02 15:04:00* Is it possible to enforce the same format as MySQL across the board?, I wasn't able to locate related documentation on this. PS : Freeradius version 3.0.8 Thanks, -- *Anuruddha Premalala (MIEEE)Mobile : +94717213122E-mail : anuruddhapremalal@gmail.com <anuruddhapremalal@gmail.com>web : www.anuruddha.org <http://www.anuruddha.org>*
On 13-10-16 12:37, Anuruddha Premalal wrote:
Hi All,
I'm using the 'Event-Timestamp' in the python module it's printed as follows.
*Oct 12 2016 13:59:27 UTC*
However the timestamp format present in the MySQL databse is *2006-01-02 15:04:00*
Is it possible to enforce the same format as MySQL across the board?, I wasn't able to locate related documentation on this.
Normalizing to MySQL sounds pretty unusual, I'd normalize it to ISO8601. But I think the Python-module has a different problem here: the Event-Timestamp attribute is marked in the dictionary as type date. Python has a datetime class. Wouldn't it be better to pass a datetime object to the Python script instead of a stringified version of the date? -- Herwin Weststrate
On Oct 13, 2016, at 6:49 AM, Herwin Weststrate <herwin@quarantainenet.nl> wrote:
On 13-10-16 12:37, Anuruddha Premalal wrote:
Hi All,
I'm using the 'Event-Timestamp' in the python module it's printed as follows.
*Oct 12 2016 13:59:27 UTC*
However the timestamp format present in the MySQL databse is *2006-01-02 15:04:00*
Is it possible to enforce the same format as MySQL across the board?, I wasn't able to locate related documentation on this.
Normalizing to MySQL sounds pretty unusual, I'd normalize it to ISO8601.
But I think the Python-module has a different problem here: the Event-Timestamp attribute is marked in the dictionary as type date. Python has a datetime class. Wouldn't it be better to pass a datetime object to the Python script instead of a stringified version of the date?
I started converting some stuff to proper Python types in v3.1.x/v4.0.x, but the default type is string for most dictionary types. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (3)
-
Anuruddha Premalal -
Arran Cudbard-Bell -
Herwin Weststrate