|
Answer» hi i am trying to make a Turn clock this is how it works... it gets the current time from the time zone UTC-6 then it CALCULATES how long it takes for 30mins to past and displays the time e.g. if the UTC-6 time says 1:00:00 am the turn time will DISPLAY 30:00 it will then start counting down until the UTC-6 time says 1:30:00 am this is when the turn time will reset itself back to 30:00 and then continue counting down until the next cycle.. here is the script i use to work out the UTC-6 time :
function TS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()-21600000); return x; } function tN(){ return new Date(); } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function dT(){ if(fr==0){ fr=1; document.write('<span id="tP">'+eval(oT)+'</span>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } var fr=0,oT="tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+aP(tS().getHours())";
Game Time : dT();
so could you help pleaseplease can some one help... i have tryed to fidure out how to do it but with no sucsess :/See herei have finaly figured it out T.T
i now need help with an ajax REQUEST.
how do i send a ajax request and then how to i save the responses and variables? when i visit the url for the ajax request this is what is DISPLAYED : {"untrainedSold":"1315","attackTurns":"30","gold":"1117417850","gameTime":"10:21:12AM","nextTurn":"09:01"}
i need each saved as there own variable so please help
|