You are not logged in.
Offline
Offline
Hello,
I want 2 clocks on my website.
Clock one displays time in Europe.
Clock two displays time in America.
Can anyone help me out?
Thanks
Offline
Okay, then we make up some PHP for the American clock.
As an example, if my server was in GMT-05:00, but I lived in GMT-7:00 and wanted to have the clock reflect where I am, the difference is -2 hours (we take away two hours from -7 to get -5).
$hours = number of hours difference
$format = the string format to use
<txp:php>
$hours = -2;
global $dateformat;
echo safe_strftime($dateformat, time() + ($hours * 3600));
</txp:php>
Does that make any sense?
(Edit: updated to supply correct code for any passers-by.)
Last edited by Mary (2005-08-30 21:56:53)
Offline
i don’t know if it makes sense i put youre line of code in my pagetemplate and its reaction was ’01/01/70’? this is the website im working on www.jornjorn.com
hopefully you can help me out…
Offline
sorry it is still not working im really new to textpattern and php so… now my code says:
<p>Netherlands</p><txp:upm_datetime />
<p>United states</p><txp:php>$hours = GMT-6; global $dateformat; echo safe_strftime($dateformat, time() + $hours);</txp:php>
and it still is not working. what am i doing wrong?
tanx
Offline