Time Stamp between Server & Users

Is message board greying out your hair (at least what's left of it)? Let us help you here
Locked
ronmerk
Posts: 10
Joined: Wed Jan 11, 2006 4:29 pm

Time Stamp between Server & Users

Post 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
FruitBeard
Posts: 38
Joined: Thu Jul 21, 2005 6:25 pm

Post 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
FruitFully yours

http://www.fgps.com/keith/
FruitBeard
Posts: 38
Joined: Thu Jul 21, 2005 6:25 pm

Post 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());
FruitFully yours

http://www.fgps.com/keith/
ronmerk
Posts: 10
Joined: Wed Jan 11, 2006 4:29 pm

Thank You

Post by ronmerk »

Hi Keith:

Just to let you know. Your solution worked great!

Thanks

Ron
rossrc
Posts: 2
Joined: Sun Sep 16, 2007 8:20 pm

What other changes do you need to make?

Post 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?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

See http://php.net/date , you have a few examples there.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Locked