esp-idf/components/fatfs
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
..
diskio Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
port Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
src fatfs: Fix putc_bfd compilation warning 2022-04-14 11:55:33 +02:00
test fatfs: fix incorrect mtime returned for files created during DST 2023-02-09 11:28:29 +00:00
test_fatfs_host fatfs: Make host sdkconfig compatible 2020-11-17 22:51:07 +00:00
vfs fatfs: fix incorrect mtime returned for files created during DST 2023-02-09 11:28:29 +00:00
CMakeLists.txt sdspi: support crc16_be for esp32s2 2020-02-12 15:15:46 +08:00
component.mk fatfs: create separate ffsystem.c for host side testing 2019-06-25 23:07:07 +08:00
Kconfig docs: added some fast-seek documentation to the fatfs.rst 2020-11-06 13:18:16 -03:00