Page 1 of 1

Time Stamp between Server & Users

Posted: Fri Jan 13, 2006 12:14 am
by ronmerk
Script URL: http://www.victoriabariatricsurgery.com ... mboard.php
Version of script: Latest
Version of PHP: 5*
Hosting company: Paid hosting
Have you searched THIS FORUM for your problem: Yes
(if not please do before posting)
If so, what terms did you try: time, server, date

Write your message below:

Hi Everyone:

First, I want to thank Henrie for all his help on my 1st problem. Awesome help and best of all his solution worked great

I'm very close to having MBoard working perfectly per my requirements.

One last issue to fix.

My users wanted a time stamp on thier posts. After modifying the code to make that work, I discovered that the time stamp the server applies is one hour different from where the users perceive they are.

I'm pretty sure i need to add code to the setting.php file something like this:

Code: Select all

define("C_TMZ_OFFSET", '-1');
Although this looks ok, it doesn't meet the same snytex as the existing code. Does some one know exactley what I should be using?

Thks in advance

Ron

Posted: Fri Jan 13, 2006 3:57 pm
by FruitBeard
hi there,

Inside mboard.php find this code:
$date=date ("d/M/Y");
and replace with this code:
putenv('TZ=Europe/London');
$date=date ("F j, Y", time());
I know you have changed the way you display your time so f j, Y bit will also have to be altered to what you changed it to, if that makes sense

also you will need to change your area code, and these can be found at
http://www.theprojects.org/dev/zone.txt
just change the europe/london bit to your desired area, leave TZ alone.

if you get truly stuck, then message again.

hope i helped

Posted: Fri Jan 13, 2006 3:59 pm
by FruitBeard
sorry made a boo boo

putenv('TZ=Europe/London');
$date=date ("F j, Y", time());
should be
putenv('TZ=Europe/London');
$date=date ("d/M/Y", time());

Thank You

Posted: Sun Jan 15, 2006 12:38 am
by ronmerk
Hi Keith:

Just to let you know. Your solution worked great!

Thanks

Ron

What other changes do you need to make?

Posted: Sat Jan 12, 2008 6:29 am
by rossrc
putenv('TZ=Europe/London');
$date=date ("F j, Y", time());
should be
putenv('TZ=Europe/London');
$date=date ("d/M/Y", time());
[/quote]


So I made this change to my script, however it still doesn't add a time stamp in. What other changes need to be made to get this to work?

Posted: Sat Jan 12, 2008 10:41 am
by Klemen
See http://php.net/date , you have a few examples there.