2020-07-28 16:01:31 +01:00
|
|
|
#include <time.h>
|
2017-01-27 11:42:57 +00:00
|
|
|
#include "lib/oofatfs/ff.h"
|
2016-02-13 21:03:23 +00:00
|
|
|
|
|
|
|
DWORD get_fattime(void) {
|
2020-07-28 16:01:31 +01:00
|
|
|
time_t now = time(NULL);
|
|
|
|
struct tm *tm = localtime(&now);
|
|
|
|
return ((1900 + tm->tm_year - 1980) << 25)
|
2020-08-31 05:59:10 +01:00
|
|
|
| ((tm->tm_mon + 1) << 21)
|
2020-07-28 16:01:31 +01:00
|
|
|
| (tm->tm_mday << 16)
|
|
|
|
| (tm->tm_hour << 11)
|
|
|
|
| (tm->tm_min << 5)
|
|
|
|
| (tm->tm_sec / 2);
|
2016-02-13 21:03:23 +00:00
|
|
|
}
|