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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.