-
Notifications
You must be signed in to change notification settings - Fork 140
creation time is incorrect for files uploaded to the board #221
Copy link
Copy link
Open
Description
Hello,
I tried to use rsync to upload updated files in rshell with my RPi Pico board and it didn't work for me. The problem is that my timezone is +6 to UTC and all files uploaded to the board get creation time in future. It seems that the problem occurs because rshell uses the current local time to set the current time on the board. As Micropython doesn't have any timezone information, the time is interpreted as UTC time.
For now I fixed this like follows but, perhaps, there's a better way?
$ git diff
diff --git a/rshell/main.py b/rshell/main.py
index 7a810d9..80526fb 100755
--- a/rshell/main.py
+++ b/rshell/main.py
@@ -1657,7 +1657,7 @@ class Device(object):
def sync_time(self):
"""Sets the time on the pyboard to match the time on the host."""
- now = time.localtime(time.time())
+ now = time.gmtime(time.time())
self.remote(set_time, (now.tm_year, now.tm_mon, now.tm_mday, now.tm_wday + 1,
now.tm_hour, now.tm_min, now.tm_sec, 0))
return now
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels