Time Calculations

Question: How can I Convert the Connect Time Values in sysessions to a Readable Time?

Answer: Use the I2date Stored Procedure.

IDS systems create a stored procedure called 12date (the first character is a lower-case "L") which will calculate the date only. If you want to get the date in datetime format, run the following SQL statement:

SELECT sid,username,hostname,connected,
DATETIME(1970-01-01 00:00:00) YEAR TO SECOND + connected UNITS SECOND
FROM sysmaster:syssessions;

This gives you the date and time in GMT (Universal Time) for the connection.

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.