#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0

    Need help with website timezones for events


    Greetings All

    Let me begin by saying I am quite new to development and this is my first website. I have learnt a bit of html and css which i have used for the site.
    I plan on trying to take on some more languages, to delevop my site further in the future, But would like any advice or feedback which could help me with this problem or point me in the right direction.

    Basically the issue is A part of my site has got a events schedule. The Problem has been the time for the events. i would like to set the time of each event to the Users timezone automatically. Below is basic code of what i have been using. which has been doing this using the scirpt in the "li class="time" but i need to change the scripts time for every event... The issue being to me


    1) Would this not load the script for each event? Slowing down the site loading?

    2)How could i possibly tweak the code to remove the script from the
    Code:
     <li class="time">
    and put it on the page to only load once. Then change it to ie.
    Code:
     <li class="time">4:45pm</li>
    and that automatically changes to the users time from whats entered to there own Timezone from the script being loaded once on the page at the top of the page?

    Code:
    <div class="programme">
                 <ul class="guides">
                    <a href="domain/xxxxx.php" class="guides" style="display : block; color: black; background-color: transparent;">
                        <li class="icon"><img src="images/event/????.png" alt="Schedule" width="26" height="27" class="icon"/></li>
                        <li class="time"><script>"src="http://www.thetimezoneconverter.com/js/ttzc.js"></script><script>new TTZC.Widget({  version:'inline',  t:'4:45 PM',tz:'London'}).display();</script></li>
                        <li class="game">Team A vs Team B</li>
                        <li class="location">Venue</li>
                  </a>
             </ul>
    </div>
    If that doesnt seem possible, is there some where i can be pointed in to find out more or learn about what languages would be needed to be able to just write out the info in a database like this below which the website can pull down the info and place each variable in the correct place in the html code and css. Basically making it a bit more automated that the code is there and i just need to provide the info.


    Info(a href), Event Time Game Location
    xxxxx.php ????.png 06:00pm Team A vs Team B Field B
    yyyy.php ????.png 07:30pm Player A vs Player B Table 1
    zzzz.php ????.png 07:30pm Player A vs Player B Table 2
    hhhh.php ????.png 07:30pm Player A vs Player B Table 3



    Any help will be greatly appreciated, And being new to this any thing i dont understand in your replies i will try research more info on so i may provide you with the info or understand what you saying.

    Thank you
    Kind Regards
  2. #2
  3. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400
    Use the HTML 5 <time> like
    Code:
    <time datetime="2013-10-09T16:45Z">whatever you want</time>
    You can then use Javascript to reformat the contents of all the <time>s according to the user's timezone.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    Thank you requinix, I'll give that a shot..

    Just to clarify If im correct would i just change it to
    Code:
    <li class="time"><time datetime="2013-10-09T16:45Z">whatever you want</time></li>
    And then use one of the javescripts that use
    Code:
     "getTimezoneOffset"
    to get the users timezone to change the ouput of the time displayed?

    Thanks again
  6. #4
  7. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400

IMN logo majestic logo threadwatch logo seochat tools logo