Handling different time zones

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
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Handling different time zones

Post by GeXus »

There are two methods to handle different time zones (at least that I know of)...

1. Take the GMT time and use math to add/subtract relative to whatever time zone you select.

2. Use putenv() to actually set the TZ variable.


Which way would you guys say is the best? If it even matters..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Best in terms of...?

Offsetting from GMT is most portable, but requires the code to know what offset to use.
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

feyd wrote:Best in terms of...?

Offsetting from GMT is most portable, but requires the code to know what offset to use.
Okay, yeah that works... I have the offsets... thanks!
Post Reply