Displaying date and time

I have Java code pasted direct in the Sidebar Widget (Custom HTML Content). But I want the date-time to be displayed in the bottom of the header area insterad, either on the image or just below it. My website is www.enigmar.net and I have copied part of the home page for you, and please see the red annotations.


Thanks as always for your great support!

Hello,

Thanks for using our theme and the kind words!

Please try the following:

  1. Change the widget JS code to:

    var tday=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
    var tmonth=["January","February","March","April","May","June","July","August","September","October","November","December"];

    function GetClock(){
        var d=new Date();
        var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear();
        var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds();

        if(nmin<=9) nmin="0"+nmin;
        if(nsec<=9) nsec="0"+nsec;

            if(ndate>10&&ndate<20){ndate+="th";}
        else if(ndate%10==1){ndate+="st";}
        else if(ndate%10==2){ndate+="nd";}
        else if(ndate%10==3){ndate+="rd";}
        else{ndate+="th";}

     var clocktext=""+tday[nday]+", "+ndate+" "+tmonth[nmonth]+" "+nyear+" "+nhour+":"+nmin+":"+nsec+"";
        
        document.getElementById('clockbox').innerHTML=clocktext;

    }

    // Move clock position
    document.querySelector('.sydney-hero-area').after( document.getElementById('clockbox') );

    GetClock();
    setInterval(GetClock,1000);

  1. Add the given custom CSS code below at Appearance > Customize > Additional CSS:

    .sydney-hero-area + #clockbox {
    	text-align: right;
    	padding: 10px 20px 0px 0px;
    	font-weight: bold;
    }

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Rodrigo, This is brilliant. Worked perfectly. Thanks for your help.

Hello,

Great the issue is now resolved!

If you are satisfied with our theme and support, would be great if you leave your comment and rating in the offical WordPress Themes repository. That helps us a lot: [Sydney] Reviews | WordPress.org

Let us know if you need further help.

Kind Regards,

Rodrigo.

aThemes Support