How do computers synchronize their clocks with the standard time
The Network Time Protocol (NTP) uses a rather simple basis, it assumes that the roundtrip time is divided equally between up and down delays after server processing is subtracted.

NTP keeps 4 timestamps per poll: client send $t_0$, server receive $t_1$, server send $t_2$ and client receive $t_3$. Server timestamps being in the server's clock and client timestamps being in the client's clock (that possibly needs adjusting).

Then the offset from one clock to the other is

$$\theta = \frac{(t_1-t_0)+(t_2-t_3)}{2}$$

The client will do statistical analysis to average out the delta and filter out outliers (filtering out excessive roundtrips for example) before adjusting the clock.

It is possible to use GPS to synchronize