Extend User IO, OS_GetDate for linux

This commit is contained in:
Krzosa Karol
2024-01-14 17:18:58 +01:00
parent bad74c2dcd
commit 2eb1bbdfd9
6 changed files with 37 additions and 13 deletions

View File

@@ -375,7 +375,7 @@ OS_API OS_Date OS_GetDate(void) {
result.day = local.wDay;
result.hour = local.wHour;
result.second = local.wSecond;
result.milliseconds = local.wMilliseconds;
// result.milliseconds = local.wMilliseconds;
return result;
}
@@ -557,7 +557,17 @@ OS_API int64_t OS_GetFileModTime(S8_String file) {
}
OS_API OS_Date OS_GetDate(void) {
time_t t = time(NULL);
struct tm date = *localtime(&t);
OS_Date s = {0};
s.second = date.tm_sec;
s.year = date.tm_year;
s.month = date.tm_mon;
s.day = date.tm_mday;
s.hour = date.tm_hour;
s.minute = date.tm_min;
return s;
}

View File

@@ -25,7 +25,6 @@ struct OS_Date {
uint32_t hour;
uint32_t minute;
uint32_t second;
uint32_t milliseconds;
};
typedef struct OS_FileIter OS_FileIter;