Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Convert table with dynamic time data to be viewable as a web page online?

Posted on 2014-11-17
6
95 Views
Last Modified: 2014-11-20
I have a table with dynamically changing time data.  Each time the sheet is refreshed, the correct time for each time zone is shown.  I need to convert that so that it shows up online.
Countries.xlsx
0
Comment
Question by:frugalmule
  • 3
  • 2
6 Comments
 
LVL 9

Assisted Solution

by:Brian Tao
Brian Tao earned 167 total points
ID: 40447714
Why don't you just use a page that's already on the Internet? like http://www.timeanddate.com/worldclock/full.html
0
 

Author Comment

by:frugalmule
ID: 40447729
I do not know how to combine it with the data I already have in the table.  I need all the data in the table, not just the times.
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 333 total points
ID: 40447817
You can set the time according to a locale with date_default_timezone_set().  Please see the first demonstration script in this article.
http://iconoun.com/demo/temp_frugalmule.php

<?php // demo/temp_frugalmule.php
error_reporting(E_ALL);
echo '<pre>';

// TIMEZONES AROUND THE GLOBE
$locations
= array
( 'Pacific/Auckland'
, 'Australia/Sydney'
, 'Australia/Perth'
, 'Asia/Tokyo'
, 'Asia/Calcutta'
, 'Asia/Tel_Aviv'
, 'Africa/Cairo'
, 'Europe/Rome'
, 'Europe/London'
, 'Atlantic/Bermuda'
, 'America/Chicago'
, 'America/Anchorage'
, 'Pacific/Honolulu'
, 'UTC'
)
;
// ITERATE OVER THE TIMEZONES
foreach ($locations as $location)
{
    // SET THE TIMEZONE FOR DISPLAY
    date_default_timezone_set($location);

    // SHOW THE LOCATION AND THE CURRENT DATE / TIME
    echo PHP_EOL . str_pad($location, 24, ' ');
    echo date('r');

    // SHOW THE NUMBER OF SECONDS SINCE THE EPOCH, RECOMPUTED IN EACH TIMEZONE
    echo ' ' . number_format( time() );
}

Open in new window

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:frugalmule
ID: 40447841
That is only showing the syntax > http://tedpenner.com/countries/
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 333 total points
ID: 40447850
It's a standalone script, meant to be used as a teaching example.  It's not designed to be embedded into a blog.  You can see it in action on my server, here:
http://iconoun.com/demo/temp_frugalmule.php
0
 

Author Closing Comment

by:frugalmule
ID: 40455780
Thanks
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question