In MySQL I have the following table:
CREATE TABLE `info` (
`created` int(11)
);
And it is linked (via JDBC SQL Gateway) to Cache table mysql.info. `created` field stores unix timestamp. So when I execute this SQL in SMP:
SELECT created FROM mysql.info
I receive the following output (which is expected):
But I want to to display `created` field converted to ODBC timestamp format. To do that I call this SQL procedure
Class mysql.utils [ Abstract ]
{
/// Unix timestamp to ODBC
ClassMethod uto(unixstamp As %Integer) As %TimeStamp [ SqlName = uto, SqlProc ]
{
set startday = $zdh("1970-01-01 00:00:00",3)
set endday = (unixstamp \ (60 * 60 * 24))
set endtime = (unixstamp # (60 * 60 * 24))
set totalday = endday + startday
quit $zdt(totalday _ "," _ endtime, 3)
}
}