Let's find out how to set Date and time via command line on linux and windows: On Linux via terminal…