It seems to me like the PHP addon is pretty much just serving (nearly) the same javascript and just inserting a more precise time to the millisecond at the end.
Since the client side implementation already reads the time from the HTTP Date header, it might help reduce the duplication of code between the two if the PHP version just set a custom header (like X-Precise-Date, just so you arent messing with the Date header) that contains the date as a string that's parseable by Date() in js if it exists.
It seems to me like the PHP addon is pretty much just serving (nearly) the same javascript and just inserting a more precise time to the millisecond at the end.
Since the client side implementation already reads the time from the HTTP
Date
header, it might help reduce the duplication of code between the two if the PHP version just set a custom header (likeX-Precise-Date
, just so you arent messing with theDate
header) that contains the date as a string that's parseable byDate()
in js if it exists.