Page 1 of 1

time stamp to reflect user's time?

Posted: Tue Aug 06, 2002 9:25 am
by mobb
My hosting company is on west coast. Users are on east coast. How do I change the time stamp on posts in my PHP bullentin board (much like this one) to reflect east coast time, instead of west coast?

Here's what I have in the time format:
M j, Y, g:i a

I'm new to PHP, so a simple solution would be appreciated. Thanks!

Posted: Tue Aug 06, 2002 9:31 am
by hob_goblin
http://www.php.net/manual/en/ref.datetime.php

use one of those functions, and just add xxxx seconds to it...(or subtract)

mmmm

Posted: Tue Aug 06, 2002 10:54 am
by AVATAr
Mobb you can record theGMT in the user information.

When the users log in you site you can use sessions to know where he/she is so you can make the convertion.

Maybe it helps...

how bout this?

Posted: Tue Aug 06, 2002 12:30 pm
by mobb
i added this, and it seems to work.

putenv("TZ=America/New_York");

what do you think?

Re: how bout this?

Posted: Tue Aug 06, 2002 12:35 pm
by mobb
mobb wrote:i added this, and it seems to work.

putenv("TZ=America/New_York");

what do you think?
even better, i'll use
putenv("TZ=EST5EDT");