I'm developing a website that uses Comet to transmit data back to web clients. My application is very time sensitive, I have a graph displaying points added every second.
Since the web application is Comet driven there is no real need for the client to handle dates, it should only use the server timestamp to display information. i.e. a plotted point on the graph should display in the tooltip the server timestamp, regardless of the user's timezone.
I think my best approach would be to retrieve the server's timestamp using REST. Then measure the timezone offset between the server and client time, add/deduct the difference and use it as the client's timestamp for display purposes.
Is there a way to override the default behavior of new Date()
to result in me having the server's timestamp as the local?
Many thanks.