• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

want client's time zone from server side

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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..?
 
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim..., could you please suggest how can i get client location from his IP in java or jsp
 
Sheriff
Posts: 28370
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic