Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Browser time vs Server Time.

Reply
Thread Tools

Browser time vs Server Time.

 
 
BigKat
Guest
Posts: n/a
 
      07-14-2006
I have a jsp / portlet / webservices application that has realtime
graphing capabilities. The problem I am having is when the machine
that is serving up the jsp / portlet is in a different timezone than
the machine that the browser is running on.

For example, application / server machine is running in New York,
therefore that is where the locale from the request is from. The
browser is being run on a box in California.. The data showing up in
the graph is in the New York timezone. So it appears to be 3 hours
off for the user that has his web browser on his pc in his office.

So now to my question. Has anyone retrieved the browsers machine
timezone. My thought is that the code would have to be in a jsp (some
script language??).

any help would be appreciated.

 
Reply With Quote
 
 
 
 
Mohan Kakulavarapu
Guest
Posts: n/a
 
      07-14-2006
I assume the graph generation code is in your JSP. When the JSP is
being executed
you have to pass the browsers's local time zone in the request or it
must be
previously set either in session or application objects.
If end user is accessing the JSP page by typing in the URL directly, I
don't have a
solution. If the JSP page is accessed through some HTML hyperlink or
through FORM
action, then in this HTML page you can have a hidden field which can be
set
to local timezone using javascript Date Object. This hidden field will
be available
in request object to your JSP. Hope this helps


Mohan Kakulavarapu
Freelance Java Developer


BigKat wrote:
> I have a jsp / portlet / webservices application that has realtime
> graphing capabilities. The problem I am having is when the machine
> that is serving up the jsp / portlet is in a different timezone than
> the machine that the browser is running on.
>
> For example, application / server machine is running in New York,
> therefore that is where the locale from the request is from. The
> browser is being run on a box in California.. The data showing up in
> the graph is in the New York timezone. So it appears to be 3 hours
> off for the user that has his web browser on his pc in his office.
>
> So now to my question. Has anyone retrieved the browsers machine
> timezone. My thought is that the code would have to be in a jsp (some
> script language??).
>
> any help would be appreciated.


 
Reply With Quote
 
 
 
 
Nigel Wade
Guest
Posts: n/a
 
      07-17-2006
BigKat wrote:

> I have a jsp / portlet / webservices application that has realtime
> graphing capabilities. The problem I am having is when the machine
> that is serving up the jsp / portlet is in a different timezone than
> the machine that the browser is running on.
>
> For example, application / server machine is running in New York,
> therefore that is where the locale from the request is from. The
> browser is being run on a box in California.. The data showing up in
> the graph is in the New York timezone. So it appears to be 3 hours
> off for the user that has his web browser on his pc in his office.
>
> So now to my question. Has anyone retrieved the browsers machine
> timezone. My thought is that the code would have to be in a jsp (some
> script language??).
>
> any help would be appreciated.


Don't use relative times, use absolute times. I.e. do away with the ambiguity of
local timezones, DST etc. and use UTC in all communication between the client
and server. Let the client display the time in whatever way is appropriate,
UTC, local, with or without DST etc.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail :
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross-browser Real-time Message, Remote JavaScript Callback, and Monitoring Browser States msdngroup ASP .Net Web Services 5 01-30-2008 06:26 PM
Cross-browser Real-time Message, Remote JavaScript Callback, and Monitoring Browser States msdngroup ASP .Net 5 01-30-2008 06:26 PM
Re: Cross-browser Real-time Message, Remote JavaScript Callback, and Monitoring Browser States msdngroup ASP .Net 0 12-15-2007 08:38 PM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
How to send a query to the browser from time to time? Admin Python 9 07-20-2005 12:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57