eive-obsw/mission/utility/Timestamp.cpp
Jakob Meier 8cddbf86d9
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
flash read command
2021-12-23 11:07:19 +01:00

29 lines
998 B
C++

#include "Timestamp.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
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() {
timestamp << std::to_string(time.year) << "-"
<< std::setw(2) << std::setfill('0')
<< std::to_string(time.month) << "-"
<< std::setw(2) << std::setfill('0')
<< std::to_string(time.day) << "--"
<< std::setw(2) << std::setfill('0')
<< std::to_string(time.hour) << "-"
<< std::setw(2) << std::setfill('0')
<< std::to_string(time.minute) << "-"
<< std::setw(2) << std::setfill('0')
<< std::to_string(time.second) << "--";
return timestamp.str();
}