Lucifer.iix Posted November 17, 2013 Share Posted November 17, 2013 (edited) Sorry to say: How can i test this ? Wait until the correct date ? :cool: $Context->DateTime()(); <- This is the time, and i'm clueless about the implementation. So: $Context->DateTime() can return a test datetime function or a production datetime function like: time(). So, if your implementation is dependend on time, then you have to inject your dependencie. That way, your API isn't lying at you. Look: "i'm dependend on nothing and only my friend knows to use me." :o Ps: I use my (small!) context as `global space` and carry it around. :( There only leaf objects (tree object graph) in it or simple functions like: time. Happy Hacking (and testing) : Roger Edited November 17, 2013 by Lucifer.iix Optional ? Quote Link to comment Share on other sites More sharing options...
Lucifer.iix Posted November 17, 2013 Share Posted November 17, 2013 Yes ... I am back to this. :) I am trying to set it up so that when my war ends ... it will delete the record from the table. I realize that I have to do a comparison of the current time and the time that the war ends, which is already stored in a table. My confusion lies in how and where I would implement this code. I have read all the various time type functions that I can find ... but they all give examples with interval or do comparisons to show the difference. I already know how to do the difference comparison as I have set up a count down clock for the players to see how much time is left until the end of the war. I really am stumped on this. I don't know how to write it, which file it would go in or even if I should use php or something else. Maybe just try to tell what you want to do. Do you want to store data in a database for searching/selecting ? like: CURRENT_TIMESTAMP() + ..... Are you writing PHP code for the war and are all people inside your WAR online at the time and doing HTTP request ? like: if(Time->Now() =< War->EndTime()) { .... Maybe explain more. Happy Hacking: Roger. Quote Link to comment Share on other sites More sharing options...
Lucifer.iix Posted November 17, 2013 Share Posted November 17, 2013 (edited) But... I bet none of you knew this; SQL SELECT IFNULL(('12-04-2001' = '12/04/2001'), 'Nope', 'Yep'); PHP var_dump(('12-04-2001' === '12/04/2001')); I can clearly see, these two PHP strings are not equal. PHP is really horrible with types, just like Java. It's really embarising bad. Clueless about why these awfull languages get's mainstream. Maybe `quick and dirty` has something to do with it. :D Happy Hacking. Edited November 17, 2013 by Lucifer.iix Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.