(RADIATOR) UTC Timestamp in SQL String Format...

Roy Badami roy.badami at globalgraphics.com
Mon Mar 7 11:29:50 CST 2005


FWIW, I do the following in PostgreSQL, using the DBMS to turn the
integer into a timestamp.  


<SessionDatabase SQL>
        AddQuery        INSERT INTO sessiondb (username, nasidentifier, nasport, acctsessionid, time_stamp, framedipaddress, nasporttype, servicetype) VALUES ('%u', '%1', %2, %3, timestamp with time zone '1970-01-01 00:00:00+00:00' + %{Timestamp} * interval '1 second', '%{Framed-IP-Address}', '%{NAS-Port-Type}', '%{Service-Type}')
	...
</SessionDatabase>


(Incidentally you could write

	timestamp with time zone 'epoch'

instead of

	timestamp with time zone '1970-01-01 00:00:00+00:00'

but I regard the latter as more explicit, since we're actually
refering to the epoch for RADIATOR timestamps, rather than the
PostgreSQL epoch (even though they _happen_ to be the same.)

Don't know how easy this is to accomplish in other DBMSs...

	   -roy


--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list