"want client's time zone from server side":--
i am using an web application which runs on remote server, it shows the time and date in EST format as that of its server but i want to display that in its client's timezone
i tried to make so many changes in JSP and Java action classes but it always gives time in EST i.e. server side format....
can anyone please help me how can i get timezone of client which could be in any timezone..?
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
0
You could use the client's IP adress to determine (approximately) her country and possibly city. That could be used to obtain the timezone. Alternatively, embed JavaScript code that contacts the server with the client-side time. The Java/JSP code running on the server will only ever give you the server time, so that's a dead end.
prajyot jadhav
Greenhorn
Joined: Dec 26, 2011
Posts: 6
posted
0
Thanks Tim..., could you please suggest how can i get client location from his IP in java or jsp
You could use some Javascript code which converts a date in the server's time zone to the corresponding date in the client's time zone. You'll notice that this forum displays times in your timezone; that's because it uses that Javascript code.