On Jul 9, 11:25am, Authur Lin wrote:
> Subject: (RADIATOR) Wrong datetime result
> Hello,
>
> I want to log Start/Stop time for each session in ACCOUNTING table (use
> MySQL as SQL server) using the following configuration and MySQL
> setting. I want to have the time format YYYY-MM-DD HH:MM:SS( for
> example: 1999-07-09 10:05:30). It works, but the content of TIME_STAMP
> filed in table ACCOUNTING is strange:
>
> Log :
> insert into ACCOUNTING
>                 (ACCTAUTHENTIC, USERNAME, FRAMEDPROTOCOL,
> ACCTSTATUSTYPE, NASIPA
> DDRESS, NASPORT, NASPORTTYPE, ACCTSESSIONID, FRAMEDIPADDRESS,
> SERVICETYPE, TIME_
> STAMP) values  ('RADIUS', 'chiuchiu', 'PPP', 'Start', '210.208.161.225',
> 1, 'Async', '1e00004603', '210.208.164.81', 'Framed-User', 931487024)
>
> Field content in ACCOUNTING table:
> TIME_STAMP: 2000-09-31 48:70:24
>
> Could anyone tell me why ? ( I have checked the system date is right:
> Fri Jul  9 11:14:34 CST 1999) or how to set the configuration and MySQL
> if I want to get the right datetime format ?
Yes, because you are passing an integer to a datetime column:

931487024 -> 2000-09-31 48:70:24

can you see what its doing? Its assuming year 2000, but month, day etc its
getting from the integer. You mysql documentation describes this clearly.

You need either to define your column as an integer type, or use Radiator or
mysql conversions to turn the Timestamp integer into a date suitable for a
datetime column.

Cheers.

>
>
> <AuthBy SQL>
>         ...
>         AcctColumnDef   NASIPADDRESS,NAS-IP-Address
>         AcctColumnDef   NASPORT,NAS-Port,integer
>         AcctColumnDef   NASPORTTYPE,NAS-Port-Type
>         AcctColumnDef   USERNAME,User-Name
>         AcctColumnDef   CALLEDSTATIONID,Called-Station-Id
>         AcctColumnDef   TIME_STAMP,Timestamp,integer
>         ...
>
> MySQL:
>
>     Field : TIME_STAMP    Type: datetime
>
>
> Authur
>
>
> ===
> Archive at http://www.thesite.com.au/~radiator/
> To unsubscribe, email '[EMAIL PROTECTED]' with
> 'unsubscribe radiator' in the body of the message.
>-- End of excerpt from Authur Lin



-- 
Mike McCauley                               [EMAIL PROTECTED]
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8, 
NT, Rhapsody
===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to