I have following query,
SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(rc_timestamp) AS LAG_TIME FROM recentchanges ORDER BY rc_timestamp DESC LIMIT 1
In my python code I am trying to get it to convert into seconds, but what I am currently getting is following:
{'LAG_TIME': 32L}
I tried with utf but results is same.
getLagTime = ur"""SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(rc_timestamp) AS LAG_TIME FROM recentchanges ORDER BY rc_timestamp DESC LIMIT 1"""
cursor.execute(getLagTime)
lagTime = cursor.fetchall()
for time in lagTime:
print time
print unicode(time['LAG_TIME'], 'utf-8', error='strict')