I would like to set the date(and time) on an accessible linux system to the date and time of the system I am connecting with (a windows 10 system). I know the "date --set blabla" command can be used to set the date and time, but I am not sure how to do this with relative ease. My accessible linux system does not have internet access of any variety.
Asked
Active
Viewed 846 times
1
1 Answers
0
I grabbed a copy of date.exe from UnitUtils and renamed it ldate.exe to prevent naming conflicts with windows.
Then I made a bat script like this.
del time.txt
ldate.exe -R > time.txt
set /p DVAL=<time.txt
echo sudo date -s "%DVAL%" > time.txt
putty raspberrypi.local -l pi -pw raspberry -m time.txt
pause

Thomas Epperson
- 11
- 1
https://unix.stackexchange.com/questions/151547/linux-set-date-through-command-line
– Artem S. Tashkinov Jun 23 '20 at 16:11