User:Aiiane/Sandbox/PSTime



function tS{ x=new Date(tN.getUTCFullYear,tN.getUTCMonth,tN.getUTCDate,tN.getUTCHours,tN.getUTCMinutes,tN.getUTCSeconds); x.setTime(x.getTime+dS-28800000); return x; } function tN{ return new Date; } function dS{ return ((tN.getTime>fD(0,2,3,2).getTime)&&(tN.getTime0){ week-=7; } if(p>0&&dOff<0){ week+=7; } x.setTime(x.getTime+((dOff+week)*86400000)); } return x; } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; } function dT{ if(fr==0){ fr=1; document.write(' '+eval(oT)+' '); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT',1000); } function aP(x){ return (x>11)?'pm':'am'; } var mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="tS.getDate+dE(tS.getDate)+' '+mN[tS.getMonth]+' '+':'+':'+' '+tH(tS.getHours)+':'+lZ(tS.getMinutes)+':'+lZ(tS.getSeconds)+' '+aP(tS.getHours)";

dT;