How to sync windows 10 clock to internet from commandline?

How to sync windows 10 clock to internet from commandline?

I would like to be able to synchronize my windows 10 computer clock when it goes out of sync... From the commandline with 1 command.
This solution shows how to do it via settings.
https://superuser.com/a/1050717/44355
Is there a way to perform this via some windows 10 api on the commandline?

Solutions/Answers:

Answer 1:

Start a PowerShell with elevated rights and use the W32tm command:

W32tm /resync /force

For further reading: interesting article about the difference between NET TIME and W32tm.

Our Awesome Tools

References

Related:  What is the difference between iisreset, recycle, refresh and restart?