Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 167149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:13:24+00:00 2026-05-11T12:13:24+00:00

This code displays times zones vertically. I would like to display them horizontally but

  • 0

This code displays times zones vertically. I would like to display them horizontally but with appropriate spacing. I want to replace the ‘br’ break tag (second to last line of code) with a tag that will provide spacing between a new name and zone.   does not work. Simple but tricky for some reason.

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> <title>Untitled Document</title> <script type='text/JavaScript'> //Universal clock 2006 //Genuine code by Corneliu Lucian 'KOR' Rusu mailto:corneliulucian(AROND)apropo.ro var wd=['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var D=[ ['Bucharest',120,60],//city,standard time zone(minutes), DST(minutes) ['Madrid',60,60], ['New York',-300,60], ['Nairobi',180,0] ] //add in the array your cities,STZ, DST function calc(){ var spans=document.getElementById('zonediv').getElementsByTagName('span') for(var i=0;i<D.length;i++){ var t=new Date(); t.setTime(t.getTime()+(t.getTimezoneOffset()*60000)+((D[i][1]+D[i][2])*60000));//the zone's time var Dy=t.getFullYear(); var Dd=t.getDate()<10?'0'+t.getDate():t.getDate(); var Dm=t.getMonth()<10?'0'+(t.getMonth()+1):t.getMonth()+1; var Dh=t.getHours()<10?'0'+t.getHours():t.getHours();  var Di=t.getMinutes()<10?'0'+t.getMinutes():t.getMinutes(); var Ds=t.getSeconds()<10?'0'+t.getSeconds():t.getSeconds(); var Dz=wd[t.getDay()]; spans[i].firstChild.data=Dh+':'+Di+':'+Ds+' - '+Dz+' '+Dd+'/'+Dm+'/'+Dy; } setTimeout('calc()',1000) } onload=function(){ var root = document.getElementById('zonediv'); for(var i=0;i<D.length;i++){ root.appendChild(document.createTextNode(D[i][0]+' ')) var sp= document.createElement('span'); sp.appendChild(document.createTextNode(' ')); root.appendChild(sp);root.appendChild(document.createElement('br')) } calc(); } </script> </head> <body> <div id='zonediv'> </div> </body> </html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:13:25+00:00Added an answer on May 11, 2026 at 12:13 pm

    Try replacing

    root.appendChild(document.createElement('br'))

    with something like

    root.appendChild(document.createTextNode(' '))

    This would append a space instead of a br element 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code when executed displays the expected output but prints segmentation fault (core dumped)
This code lets me display/hide a custom message msg_one msg_two msg_three when the appropriate
This code correctly fetches data, and displays it; however, the sort is completely ignroed.
I have found this line of MatLab code on the internet that displays a
I am using this code to display a grid $('#table1 tr').bind('click', shows); function shows()
I have this code: def display(self): print self.doc.toprettyxml(indent= ) strigName ='/Users/my_user/Desktop/python/' + str(datetime.datetime.now()) +
I have this code to display the data retrieved from DB in accounts_view.php :
I have this code which can display drop down in div tag of html.
I am using this code in wordpress to display different content when different pages
I read this code in a library which is used to display a bitmap

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.