Skip to content

SD_MMC not using daylight saving time on file times ??? #6786

@jameszah

Description

@jameszah

Board

ESP32-S on AI-Thinker ESP32-CAM

Device Description

normal esp32-cam with camera and wifi turned on

Hardware Configuration

no

Version

v2.0.3

IDE Name

Arduino ide 1.8.19

Operating System

Windows 10

Flash frequency

80MHz

PSRAM enabled

yes

Upload speed

115200

Description

After correctly fetching the time over wifi, and creating a file on the sd card, the file date from file.getLastWrite() shows 1 hour ahead of time. When the sd is removed and put in a computer the date shows correct - 1 hour behind the date that getLastWrite shows.

This worked before the time-change on 2.02. Since the time changed in March, and the 2.03 just arrived last week or so, ... I don't know if both factors are relevant.

Would it be in the FS library?

pictures show a esp32 hosted file directory, and the same files on windows 10 "date modified".

image

image

Sketch

here is the code that just gets the date on file and prints it out.  There is my 3600 second work around.

 // sd_mmc not recognizing daylight savings time ???? jz may 21 2022 - seemed to work before dst

      //time_t t= file.getLastWrite();
      time_t t= file.getLastWrite() - 3600;
      struct tm * tmstruct = localtime(&t);
      
      char ccz[100];
      sprintf(ccz, " %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);

Debug Message

none

Other Steps to Reproduce

none

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Area: ESP-IDF relatedESP-IDF related issuesArea: LibrariesIssue is related to Library support.Status: SolvedThe issue has been resolved and requires no further action.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions