Skip to content

Commit

Permalink
Fix CurrentDateTime dropping microseconds (#1357)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Jun 11, 2019
1 parent bf2fc83 commit f4ac48e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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) + 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_MILLISECONDS ) + TIME_UNIX_EPOCH_AS_TICKS;

HAL_Time_ToSystemTime(time, &st );

Expand Down

0 comments on commit f4ac48e

Please sign in to comment.