Page 1 of 1

Handling different time zones

Posted: Mon Sep 24, 2007 9:57 am
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..

Posted: Mon Sep 24, 2007 12:00 pm
by feyd
Best in terms of...?

Offsetting from GMT is most portable, but requires the code to know what offset to use.

Posted: Mon Sep 24, 2007 12:52 pm
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!