Java Instant.toEpochMilli() & Javascript Date.now() not in sync

I am trying to collect performance metrics for streaming data coming from a server process over websocket. The server is written in Java and the client is an Angular UI application.

The server stamps the sentAtTime on the message header just before it leaves the server using Java’s Instant.toEpochMilli(). The client records the receivedAtTime using Javascript’s Date.now() as soon as it picks the message up.

I then calculate time over the wire as NetworkLag = receivedAtTime - sentAtTime

Surprisingly the lag is negative sometimes upto -30 ms which is baffling me. I have checked that the maths isn’t wrong and I also get positive lag values. The only explanation I can think of is that the clocks on the server and client are somehow are not in sync. Have others seen something like this and what are the steps I could take to remediate the situation.