Page 1 of 1

DB and Time Stamps

Posted: Fri May 30, 2008 8:17 pm
by John Adams
LE,
Would it be a real huge pain in the ass to switch all our time/date stamps to unix_timestamp now? I think it's cheaper to store and index on int(11) than `datetime` or `timestamp`:
Example from `characters` table:

Code: Select all

  `created_date` timestamp NOT NULL default '0000-00-00 00:00:00',
  `last_played` datetime NOT NULL default '0000-00-00 00:00:00',
No biggie if not. All the timestamps I am adding are int(11) is all. I long for consistency.

Posted: Fri May 30, 2008 9:00 pm
by LethalEncounter
No, I don't think it would be a pain. Feel free to do so before I leave so that I can fix the code if it does break something.

Posted: Fri May 30, 2008 9:21 pm
by John Adams
I am pretty sure the only place that time is stored currently is during character creation - and I am not sure the emulator uses the data for anything now anyway.
I just wanted to check with you before any other "date" stuff gets added (quests, guilds, tradeskills, logging). The characters date can stay until you return. No hurry. Let's just make any new date/time data the int(11) / unix timestamp format.

Posted: Sat May 31, 2008 9:11 am
by link2009
I like this idea John. unix_timestamp is easier on load considering that the traditional datetime has more data.
I don't think we'll be using dates/times until we do have quests. I would like to use this idea for quests.
For example:
Quest started on Saturday May 31st, 2008 12:11
Finished on Sunday June 1st, 2008 16:12
This way you can have 'timed' quests and possibly provide different loot based on the time used for completion.

Posted: Sat May 31, 2008 2:44 pm
by Aaden
link, thats a good idea i actually wrote an eqperl quest that did that, it kept an active timer up and the amount of time it took to complete it would throw you a different set of reward options. We could definitly do that with LE's lua system :D

Posted: Sat May 31, 2008 5:03 pm
by link2009
Those are the only ideas I get...great IDEAS! 8)
:lol: