time stamp to reflect user's time?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mobb
Forum Newbie
Posts: 3
Joined: Tue Aug 06, 2002 9:25 am

time stamp to reflect user's time?

Post 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!
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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)
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

mmmm

Post 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...
mobb
Forum Newbie
Posts: 3
Joined: Tue Aug 06, 2002 9:25 am

how bout this?

Post by mobb »

i added this, and it seems to work.

putenv("TZ=America/New_York");

what do you think?
mobb
Forum Newbie
Posts: 3
Joined: Tue Aug 06, 2002 9:25 am

Re: how bout this?

Post 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");
Post Reply