PDA

View Full Version : How to convert timelaston to a date


revloc02c
04-27-2013, 06:55 AM
In the character_ table is a column timelaston with a number which is the number of seconds since Jan 1, 1970 (http://www.eqemulator.org/forums/showpost.php?p=202365&postcount=7). I was wondering how to convert this to a date, and finally found a way:

SELECT DATE_ADD('1970-01-01', INTERVAL character_.timelaston/86400 DAY) AS 'DateLastPlayed' FROM character_;

That's one way to get a date. Not sure how to include the time. Maybe someone else knows a better way.

Derision
04-27-2013, 08:20 AM
This shows the date and time:

select name, FROM_UNIXTIME(timelaston) as 'DateLastPlayed' from character_;

revloc02c
04-27-2013, 05:12 PM
Thanks, I was hoping someone would post that.