Hi!
I've made a TimeZone script, is this interesting to other programmers?
I've thought about releasing it as GPL, but I think the way it is at the current state, it works PERFECT, but it's somewhat hard to integrate into the scripts the users might have.
If the interest is high, I might recode it to be more easy-to-implement.
it works very easy in backend:
*when user registers, he/she selects country from dropdown list (originally populated from iso3166 table).
*when user logs on, the system checks if the field TZ is NOT NULL. If it is null, the user did not choose timezone! Then run a natural join on iso3166 and another iso table, containing timezones. If numrows > 1, show dropdown list over awailible TZ, else: choose TZ as default.
*when the user then logs on, php uses the putenv to set TZ=timezone.. As we all know, mysql has no timezone! so then we use a mysql time function to subtract the difference between the server and the sql time, after putenv.
quite simple, really effective!
I use it on international members.. This way, they can easier relate to when other members where online!
ps. if only table designs are interesting, I posted them on some forum, I can try to locate it
night all!
Olav Alexander Mjelde
Admin & Webmaster
I've made a TimeZone script, is this interesting to other programmers?
I've thought about releasing it as GPL, but I think the way it is at the current state, it works PERFECT, but it's somewhat hard to integrate into the scripts the users might have.
If the interest is high, I might recode it to be more easy-to-implement.
it works very easy in backend:
*when user registers, he/she selects country from dropdown list (originally populated from iso3166 table).
*when user logs on, the system checks if the field TZ is NOT NULL. If it is null, the user did not choose timezone! Then run a natural join on iso3166 and another iso table, containing timezones. If numrows > 1, show dropdown list over awailible TZ, else: choose TZ as default.
*when the user then logs on, php uses the putenv to set TZ=timezone.. As we all know, mysql has no timezone! so then we use a mysql time function to subtract the difference between the server and the sql time, after putenv.
quite simple, really effective!
I use it on international members.. This way, they can easier relate to when other members where online!
ps. if only table designs are interesting, I posted them on some forum, I can try to locate it
night all!
Olav Alexander Mjelde
Admin & Webmaster