Fix milli secs conversion
#include <target_platform.h>
#include <Esp32_os.h>
+#define TIME_CONVERSION__TO_USECS 10
+
// Returns the current date time from the RTC
uint64_t HAL_Time_CurrentDateTime(bool datePartOnly)
{
@@ -20,7 +22,7 @@ uint64_t HAL_Time_CurrentDateTime(bool datePartOnly)
gettimeofday(&tv, NULL);
// Convert from Unix time(year since 1900) to SYSTEMTIME(Years since 1601)
- int64_t time = ((int64_t)tv.tv_sec * (int64_t)TIME_CONVERSION__TO_SECONDS) + ((int64_t)tv.tv_usec * (int64_t)TIME_CONVERSION__TO_MILLISECONDS ) + TIME_UNIX_EPOCH_AS_TICKS;
+ int64_t time = ((int64_t)tv.tv_sec * (int64_t)TIME_CONVERSION__TO_SECONDS) + ((int64_t)tv.tv_usec * (int64_t)TIME_CONVERSION__TO_USECS) + TIME_UNIX_EPOCH_AS_TICKS;
HAL_Time_ToSystemTime(time, &st );
