Jump to content

Can I put <iframe> to header.php?


cherry2016

Recommended Posts

Hi. I am new here and I don't know much about php..

But I'm trying to put digital clock to header. I'm using Wordpress.

I found these iframe codes which look like easy to put a clock for me.

 

<iframe src="http://free.timeanddate.com/clock/i5s4jcs4/n671/ts1" frameborder="0" width="94" height="18"></iframe>

<iframe src="http://free.timeanddate.com/clock/i5s4jcs4/n9/ts1" frameborder="0" width="94" height="18"></iframe>

 

I have to put Japan's time and Mexico's time.

Is it possible to put these codes to header.php?

If so, could you please teach me how?

 

Thank you so much.

Link to comment
Share on other sites

Please --- frames... just don't.

 

PHP has some great date/time/timezone handling.

 

See this simple program as an example: This code or something similar could easily go into a header:

 


$tz_mexico = new DateTimeZone('America/Mexico_City');
$tz_japan = new DateTimeZone('Asia/Tokyo');

// Time Now
$ts = new DateTime();

$ts->setTimezone($tz_mexico);
echo "Mexico:" . $ts->format('g:i a') . ' ';
$ts->setTimezone($tz_japan);
echo "Japan:" . $ts->format('g:i a');

 

See it in action!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.