I have some data that uses unixtime. I’m using Python and MySQL.
I have noticed that the MySQL GUI Tools function from_unixtime() doesn’t equal Python’s output of time.ctime() or even the MySQL cmd line interface…
MySQL Command Line:
#This returns the correct time
mysql> select from_unixtime(1295147016.45300);
+---------------------------------+
| from_unixtime(1295147016.45300) |
+---------------------------------+
| 2011-01-15 21:03:36 |
+---------------------------------+
1 row in set (0.05 sec)
MySQL GUI Tools:
# Incorrect Time!
select from_unixtime(1295147016.45300);
2011-01-16 03:03:36
Python:
#This returns the correct time
>>> import time
>>> time.ctime(1295147016.45300)
'Sat Jan 15 21:03:36 2011'
Can someone please shed some light on the discrepancies? What’s the point of having a GUI if it doesn’t show the correct data.
Thanks,
M
The time zone is different in both the cases. Just fix the time-zone in MySQL GUI tools and you’re good to go.