fsfw/src/fsfw/globalfunctions/TimeSystems.h

20 lines
443 B
C
Raw Normal View History

2024-02-12 14:42:58 +01:00
#ifndef FSFW_SRC_FSFW_GLOBALFUNCTIONS_TIMESYSTEMS_H_
#define FSFW_SRC_FSFW_GLOBALFUNCTIONS_TIMESYSTEMS_H_
#ifdef PLATFORM_WIN
#include <winsock2.h>
#else
#include <sys/time.h>
#endif
class TimeSystems {
public:
virtual ~TimeSystems() {}
static double convertUnixToJD2000(timeval time) {
2024-02-23 11:33:20 +01:00
return ((time.tv_sec + time.tv_usec * 1e-6) / 86400.0) + 2440587.5 - 2451545;
2024-02-12 14:42:58 +01:00
}
};
#endif /* FSFW_SRC_FSFW_GLOBALFUNCTIONS_TIMESYSTEMS_H_ */