Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: ehresman20030911

Message # 1019720:
Date: 04/09/04 15:30
By: Olav Alexander Mjelde
Subject: A better way to go..

Hi!

I'm in development of a superior timezone script..

My script uses three tables (included your user table).
You will need a field "TZ" and a field "country" in your users table..

Also I have two other tables:
Iso3166 and Timezone

The iso3166 contains all countrys in the world, including iso countrycodes (2 and 3 char).
The Timezone contains all timezones (with iso countrycodes (2 char)).

How will it work?
At first, it checks if the user is logged in.
If the user is logged in, it checks the TZ field in the users table.

If the TZ field is empty, the script will run a natural join on iso3166 and timezone.

If number of rows == 1, update users set TZ = timezone
else,
generate a list of timezones and a submit button

if button is submittet:
update users, set tz = timezone

I have actually made this script, and it works.. I just didnt implement it with my other scripts which gather dates from the database.

This script will do *nothing* with dates on the db, it will be just for displaying dates! eg. it wont destroy the integrity of your data.

I dont know how much time I used for this, maybe 1 hr.. but most of the time was just going back and forth, untill I figured how easy it actually is..

I will post the code when it's more tested..

Previous Message | Next Message


Comments:
RE: Is ther something wrong with this method?Jason12/01/05 19:23
cofiguring iissujamary09/17/05 13:22
I hate timezones....Ryan02/27/05 05:36
Suneel Kanuri method beats all!Marius Ooms07/30/04 13:24
RE: A better way to go..Olav Alexander Mjelde07/07/04 05:30
A better way to go..Olav Alexander Mjelde04/09/04 15:30
RE: Well DoneOlav Alexander Mjelde03/18/04 17:58
Correction - I think GMT time storage is ok!Peter Matuchniak02/10/04 00:13
RE: Here is something i did with my timezones Vinutha02/07/04 04:33
Good ArticleRoger Rain01/11/04 06:56
Here is something i did with my timezones Suneel Kanuri11/25/03 10:53
TimeZone definition in EnvironmentNikola Savic10/07/03 05:53
It's much easier if you're on *nix...Jonathan09/22/03 16:42
Sometimes it's easier to store both...Peter Matuchniak, B.Sc (Maths)09/12/03 17:32
Well DonePaul09/12/03 10:51
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.