esp-idf/components/fatfs/test
Ivan Grokhotkov d7db6c3148 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
2023-02-09 11:28:29 +00:00
..
CMakeLists.txt Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
component.mk ut: Move tests back from "esp32" subfolder 2020-01-06 17:13:53 +08:00
fatfs.img FATFS support without wear levelling 2018-06-16 16:02:35 +08:00
test_fatfs_common.c fatfs: fix incorrect mtime returned for files created during DST 2023-02-09 11:28:29 +00:00
test_fatfs_common.h fatfs: fix incorrect mtime returned for files created during DST 2023-02-09 11:28:29 +00:00
test_fatfs_rawflash.c esp_rom: extract common ets apis into esp_rom_sys.h 2020-07-27 15:27:01 +08:00
test_fatfs_sdmmc.c vfs/fatfs: fix failed tests by increasing timeout 2021-09-21 08:53:18 +02:00
test_fatfs_spiflash.c fatfs: fix incorrect mtime returned for files created during DST 2023-02-09 11:28:29 +00:00