From 9894935e9938a753cc9fcd0b00b78de0fd478985 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 12 Feb 2024 14:42:58 +0100 Subject: [PATCH] time systems --- src/fsfw/globalfunctions/timeSystems.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/fsfw/globalfunctions/timeSystems.h diff --git a/src/fsfw/globalfunctions/timeSystems.h b/src/fsfw/globalfunctions/timeSystems.h new file mode 100644 index 00000000..bb03ebd3 --- /dev/null +++ b/src/fsfw/globalfunctions/timeSystems.h @@ -0,0 +1,20 @@ +#ifndef FSFW_SRC_FSFW_GLOBALFUNCTIONS_TIMESYSTEMS_H_ +#define FSFW_SRC_FSFW_GLOBALFUNCTIONS_TIMESYSTEMS_H_ + +#ifdef PLATFORM_WIN +#include +#else +#include +#endif + +class TimeSystems { + public: + virtual ~TimeSystems() {} + + static double convertUnixToJD2000(timeval time) { + // time = {{s},{us}} + return (time.tv_sec / 86400.0) + 2440587.5 - 2451545; + } +}; + +#endif /* FSFW_SRC_FSFW_GLOBALFUNCTIONS_TIMESYSTEMS_H_ */