Skip to content

Commit

Permalink
fixed file system timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 26, 2019
1 parent 6f3d51c commit 01cff11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/eez/modules/psu/gui/file_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ void catalogCallback(void *param, const char *name, FileType type, size_t size)
int minute = fileInfo->getModifiedMinute();
int second = fileInfo->getModifiedSecond();

uint32_t utc = psu::datetime::makeTime(year, month, day, hour, minute, second);
uint32_t local = psu::datetime::utcToLocal(utc, psu::persist_conf::devConf.time_zone, (psu::datetime::DstRule)psu::persist_conf::devConf.dstRule);

fileItem->dateTime = local;
fileItem->dateTime = psu::datetime::makeTime(year, month, day, hour, minute, second);

g_filesCount++;
}
Expand Down
12 changes: 6 additions & 6 deletions src/third_party/stm32_truestudio/Src/fatfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ DWORD get_fattime(void)
RTC_DateTypeDef date;
HAL_RTC_GetDate(&hrtc, &date, 0);

DWORD res = (((DWORD)date.Year) << 25)
| ((DWORD)date.Month << 21)
| ((DWORD)date.Date << 16)
| (WORD)(time.Hours << 11)
| (WORD)(time.Minutes << 5)
| (WORD)(time.Seconds >> 1);
DWORD res = (((DWORD)(2000 + date.Year - 1980)) << 25)
| ((DWORD)date.Month << 21)
| ((DWORD)date.Date << 16)
| (WORD)(time.Hours << 11)
| (WORD)(time.Minutes << 5)
| (WORD)(time.Seconds >> 1);

return res;
/* USER CODE END get_fattime */
Expand Down

0 comments on commit 01cff11

Please sign in to comment.