EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::Server Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=601)
-   -   How to convert timelaston to a date (https://www.eqemulator.org/forums/showthread.php?t=36781)

revloc02c 04-27-2013 06:55 AM

How to convert timelaston to a date
 
In the character_ table is a column timelaston with a number which is the number of seconds since Jan 1, 1970. I was wondering how to convert this to a date, and finally found a way:

Code:

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:
Code:

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

revloc02c 04-27-2013 05:12 PM

Thanks, I was hoping someone would post that.


All times are GMT -4. The time now is 10:58 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.