Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-11-17
6
Medium Priority
?
103 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 501 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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 999 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
Ray Paseur earned 999 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
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.
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…
Suggested Courses

963 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