esp-idf/components/fatfs/vfs
Ivan Grokhotkov 507e273e1d fatfs: fix incorrect mtime returned for files created during DST
mktime function uses tm_isdst member as an indicator whether the time
stamp is expected to be in daylight saving time (1) or not (0).
FAT filesystem uses local time as mtime, so no information about DST
is available from the filesystem.

According to mktime documentation, tm_isdst can be set to -1, in which
case the C library will try to determine if DST was or wasn't in
effect at that time, and will set UTC time accordingly.

Note that the conversion from UTC to local time and then back to UTC
(time_t -> localtime_r -> FAT timestamp -> mktime -> time_t) does not
always recover the same UTC time. In particular, the local time in the
hour before DST comes into effect can be interpreted as "before DST"
or "after DST", which would correspond to different UTC values. In
this case which option the C library chooses is undefined.

Closes https://github.com/espressif/esp-idf/issues/9039
Originally reported in https://github.com/espressif/arduino-esp32/issues/6786
2022-06-09 22:02:46 +02:00
..
esp_vfs_fat.h sdspi, vfs_fat: allow sharing SPI bus among devices, and mounting multiple SD cards 2020-02-12 15:16:08 +08:00
vfs_fat_internal.h fatfs: separate IDF-specific files from the original FatFS code 2019-06-25 23:05:16 +08:00
vfs_fat_sdmmc.c soc: updates caps usage 2020-10-17 16:10:17 +08:00
vfs_fat_spiflash.c fatfs: handle FR_INT_ERR as "filesystem corrupted" 2019-08-27 00:11:45 +02:00
vfs_fat.c fatfs: fix incorrect mtime returned for files created during DST 2022-06-09 22:02:46 +02:00