1

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.

  • Please explain your issue in more details because it's not clear why you're having troubles with this command whose usage is pretty straightforward.

    https://unix.stackexchange.com/questions/151547/linux-set-date-through-command-line

    – Artem S. Tashkinov Jun 23 '20 at 16:11
  • Do you really mean you want to synchronise the time with your client, or do you mean you want to set the timezone to match? – Chris Davies Jun 23 '20 at 17:11
  • I want to have an easy way of setting the time on the remote device to the same time as my local device. Something besides manually entering the date command and waiting until the clock ticks over to the next minute to enter the command. – Thomas Epperson Jun 23 '20 at 18:05

1 Answers1

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