2021-12-11 11:56:47 +01:00
|
|
|
#include "Timestamp.h"
|
2021-12-22 11:20:05 +01:00
|
|
|
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
|
2021-12-11 11:56:47 +01:00
|
|
|
|
|
|
|
Timestamp::Timestamp() {
|
|
|
|
ReturnValue_t result = Clock::getDateAndTime(&time);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::warning << "Timestamp::Timestamp: Failed to get time" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Timestamp::~Timestamp() {
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Timestamp::str() {
|
|
|
|
return std::to_string(time.year) + "-" + std::to_string(time.month) + "-"
|
|
|
|
+ std::to_string(time.day) + "--" + std::to_string(time.hour) + "-"
|
|
|
|
+ std::to_string(time.minute) + "-" + std::to_string(time.second) + "-";
|
|
|
|
}
|
|
|
|
|