summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/vfs_lfsx.c
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/vfs_lfsx.c')
-rw-r--r--extmod/vfs_lfsx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/extmod/vfs_lfsx.c b/extmod/vfs_lfsx.c
index d00df53104..35d5f03c59 100644
--- a/extmod/vfs_lfsx.c
+++ b/extmod/vfs_lfsx.c
@@ -365,10 +365,8 @@ STATIC mp_obj_t MP_VFS_LFSx(stat)(mp_obj_t self_in, mp_obj_t path_in) {
for (size_t i = sizeof(mtime_buf); i > 0; --i) {
ns = ns << 8 | mtime_buf[i - 1];
}
- mtime = timeutils_seconds_since_2000_from_nanoseconds_since_1970(ns);
- #if MICROPY_EPOCH_IS_1970
- mtime += TIMEUTILS_SECONDS_1970_TO_2000;
- #endif
+ // On-disk storage of timestamps uses 1970 as the Epoch, so convert to host's Epoch.
+ mtime = timeutils_seconds_since_epoch_from_nanoseconds_since_1970(ns);
}
#endif