Added an additional conversion function #584

Merged
gaisser merged 15 commits from eive/fsfw:mueller/clock-addition into development 2022-04-25 15:22:15 +02:00
1 changed files with 3 additions and 0 deletions
Showing only changes of commit 7ffb4107d2 - Show all commits

View File

@ -46,6 +46,9 @@ ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) {
ReturnValue_t Clock::convertTimevalToTimeOfDay(const timeval* from, TimeOfDay_t* to) {
struct tm* timeInfo;
// According to https://en.cppreference.com/w/c/chrono/gmtime, the implementation of gmtime_s
// in the Windows CRT is incompatible with the C standard but this should not be an issue for
// this implementation
timeInfo = gmtime(&from->tv_sec);
to->year = timeInfo->tm_year + 1900;
to->month = timeInfo->tm_mon + 1;