1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help with the clock on my website ?

Discussion in 'Black Hat SEO' started by devilived, Aug 26, 2009.

  1. devilived

    devilived Junior Member

    Joined:
    Jul 13, 2009
    Messages:
    124
    Likes Received:
    59
    If Mods feel it is not the correct section please move it or delete it.

    I need help with my site clock.

    PHP:
    function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()+3600000); return x; } 
    function 
    tN(){ return new Date(); } 
    function 
    lZ(x){ return (x>10)?x:'0'+x; } 
    function 
    y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } 
    function 
    dT(){ if(fr==0){ fr=1document.write('<font size=2 face=Arial><b><span id="tP">'+eval(oT)+'</span></b></font>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } 
    var 
    dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+':'+':'+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '";


    here is what i get in my clock.js file.

    Its working fine but its one hour late.
    e.g its 13:56 on the website now , anyone can tell me how i can add 1 hour to it, so that it shows 14:56

    Thanx
    devillived
     
  2. TheHockeyGod

    TheHockeyGod Newbie

    Joined:
    Aug 11, 2009
    Messages:
    28
    Likes Received:
    8
    Wow, that's a heck of a mess. Firstly, you say PHP code but it's javascript.

    Secondly, it's way more cludgy than it should be.

    http://www.tizag.com/javascriptT/javascriptdate.php
     
  3. jimbobo2779

    jimbobo2779 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 17, 2008
    Messages:
    3,245
    Likes Received:
    2,397
    Occupation:
    Software Engineer
    Location:
    UK
    Home Page:
    I haven't checked this but have you already tried the following code?
    Code:
    
    function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),(tN().getUTCHours() - 1),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()+3600000); return x; } function tN(){ return new Date(); } function lZ(x){ return (x>10)?x:'0'+x; } function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } function dT(){ if(fr==0){ fr=1; document.write('<font size=2 face=Arial><b><span id="tP">'+eval(oT)+'</span></b></font>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+':'+':'+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '"; 
    
    
    If it were PHP it would work but as its JS I cannot be arsed to check it, sorry dude.