#1 2005-08-29 09:16:50

Mary
Sock Enthusiast
omega
From: Canada
Website

upm_datetime: Display current date/time.

upm_datetime

Display current date/time.

Last edited by Mary (2006-11-15 15:51:34)

Offline

 

#2 2005-08-29 11:38:05

Skubidu
Plugin Author
nu
Real name: Nils Hörrmann
Known languages: de, fr, en
Website

Re: upm_datetime: Display current date/time.

Simple plugin but very nice to use.
Thanks!

Offline

 

#3 2005-08-29 12:48:32

skoggy
Member
êta
From: Westcoast of Sweden
Website

Re: upm_datetime: Display current date/time.

Thanx Mary!


Txp sites:

HBK TV
mattiasskoog.se

Offline

 

#4 2005-08-29 17:50:05

jorn
New Member
alpha

Re: upm_datetime: Display current date/time.

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

 

#5 2005-08-29 18:47:28

Mary
Sock Enthusiast
omega
From: Canada
Website

Re: upm_datetime: Display current date/time.

Which timezone is your Txp admin set to, the Europe or American one?

Offline

 

#6 2005-08-29 18:50:41

jorn
New Member
alpha

Re: upm_datetime: Display current date/time.

the european one

Offline

 

#7 2005-08-29 19:15:06

Mary
Sock Enthusiast
omega
From: Canada
Website

Re: upm_datetime: Display current date/time.

Okay, then we make up some PHP for the American clock.

  1. Find the difference in hours between the server’s time and the timezone you want.
  2. Create the PHP
  3. Put it in your page (or form).

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

 

#8 2005-08-29 19:21:05

jorn
New Member
alpha

Re: upm_datetime: Display current date/time.

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

 

#9 2005-08-29 19:37:56

Mary
Sock Enthusiast
omega
From: Canada
Website

Re: upm_datetime: Display current date/time.

Whoops, sorry ‘bout that. Once more? :)

Last edited by Mary (2005-08-30 20:01:57)

Offline

 

#10 2005-08-29 23:48:54

jorn
New Member
alpha

Re: upm_datetime: Display current date/time.

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

 

Powered by PunBB
© Copyright 2002 – 2005 Rickard Andersson