0

I try to get time from server where I connect. (I need PERFECT sync ~diffrence max 1 second)

This clock is visible at bottom of page , but this clock is live (JavaScript) Javascript - get current server time, and adds connection time to page.

This code runs if supportPerformanceApi is false (variable in JS on this page )

    this.time=new Date().getTime()

else

    this.offset_from_server=Date.now()-performance.timing.responseStart;
    this.offset_to_server=performance.timing.responseStart-
                          performance.timing.fetchStart

But without javascript I get default time + connection time.

(Clock starts from 02:00:00 i think 02:00:00 bcoz GMT +2)

I want only to get server current time and I can make own thread to control actual time (by adding to current server time , "one second per second")

Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
Thomas Banderas
  • 1,681
  • 1
  • 21
  • 43

0 Answers0