Solved

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

Posted on 2014-11-17
6
89 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 108

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now