mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Set the filesystem timestamps of Blackbox files using the local… (#8570)
Set the filesystem timestamps of Blackbox files using the local timezone
This commit is contained in:
commit
cd50b35d9f
1 changed files with 5 additions and 3 deletions
|
@ -2633,11 +2633,13 @@ static void afatfs_createFileContinue(afatfsFile_t *file)
|
|||
#ifdef USE_RTC_TIME
|
||||
// rtcGetDateTime will fill dt with 0000-01-01T00:00:00
|
||||
// when time is not known.
|
||||
dateTime_t dt;
|
||||
dateTime_t dt, local_dt;
|
||||
rtcGetDateTime(&dt);
|
||||
if (dt.year != 0) {
|
||||
fileDate = FAT_MAKE_DATE(dt.year, dt.month, dt.day);
|
||||
fileTime = FAT_MAKE_TIME(dt.hours, dt.minutes, dt.seconds);
|
||||
// By tradition, FAT filesystem timestamps use local time.
|
||||
dateTimeUTCToLocal(&dt, &local_dt);
|
||||
fileDate = FAT_MAKE_DATE(local_dt.year, local_dt.month, local_dt.day);
|
||||
fileTime = FAT_MAKE_TIME(local_dt.hours, local_dt.minutes, local_dt.seconds);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue