ntpdate command not found in MacOS Mojave
For anyone trying to do this because their vm cannot connect to the update server while trying to install macos on a virtual machine, I switched my network adapter from NAT to bridged and the issue was resolved.
It's a duplicate. Please check this stackoverflow question.
TL;DR use sudo sntp -sS time.apple.com
instead.