Properly synchronising client and server times

Hi all,

I am trying to implement some client-prediction and other network techniques which require precise synchronisation to determine the latency between the clients and the server, and use the timestamps for other purposes.

However, the client time is always offset from the server time, and none of the clients share the same time, when using the default GameState::GetServerWorldTimeSeconds method, by seemingly random amounts, when testing from the dedicated server method for PIE (as shown in this solution). This difference can be quite large, and far too big for my needs.

I tried to implement the method shown in this website, which should work in theory, but it seems as though they left out several important details for the implementation, and after I got it working by patching these up myself, there was no improvement.

Is there any good way to get the world times (or any time-storing variable) for client and server synced accurately, or should I use another approach entirely?

Thank you