Globalization of Dates

The application we are developing is used from multiple countries. We would like to display the dates according to the country a user is accessing from. One way we could think of is to assign the user the country he is from in the database and then display the date accordingly. I am wondering if there is a better way to do this.

[337 byte] By [ssv45324a] at [2007-10-2 14:30:08]
# 1

Everything, of course, depends on what exactly you are developing. And uhmmm, yes, getting the users country and displaying the date accordingly will allow you to display dates according to the country a user is from. And assuming the rest of the user's info is also in a database, it would seem to make sense to put the country in the same place.

DaanSa at 2007-7-13 12:51:42 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
Since ours is a web application, i was wondering if there is any automatic way of determing
ssv45324a at 2007-7-13 12:51:42 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
There are giveaways in the request. Some browsers will include the user's locale in their User-Agent string. You could also try finding the location of the IP address from which the request originated.
DaanSa at 2007-7-13 12:51:42 > top of Java-index,Other Topics,Patterns & OO Design...
# 4

I don't do GUIs but I suspect the following is true...

Applets run on the clients computer (this I know to be true.)

The VM runs on the clients computer (again this I know to be true.)

The VM sets the default TimeZone, which creates the default SimpleDateFormat based on the computer that is running.

Now I suppose it is possible that the last might not be true. For one reason the client computer might not actually be set to the correct timezone. Or the user doesn't want the timezone that the computer is set for.

Other than that it works correctly.

Of course if you aren't using an applet then the only choice is to store a timezone somewhere because the java code won't be running on the clients computer so it couldn't possibly know what timezone the user is using without being explicitly told.

jschella at 2007-7-13 12:51:42 > top of Java-index,Other Topics,Patterns & OO Design...