archive
arduino
automation
bsp_egse
bsp_hosted
bsp_linux_board
bsp_q7s
bsp_te0720_1cfa
cmake
common
doc
dummies
fsfw
generators
linux
misc
mission
cfdp
config
controller
core
csp
devices
memory
system
tmtc
utility
CMakeLists.txt
Filenaming.cpp
Filenaming.h
GlobalConfigFileDefinitions.h
GlobalConfigHandler.cpp
GlobalConfigHandler.h
InitMission.h
ProgressPrinter.cpp
ProgressPrinter.h
Timestamp.cpp
Timestamp.h
compileTime.h
CMakeLists.txt
acsDefs.h
comDefs.h
mission.mk
scripts
test
thirdparty
tmtc
unittest
watchdog
.clang-format
.dockerignore
.gitignore
.gitmodules
CHANGELOG.md
CMakeLists.txt
Justfile
LICENSE
NOTICE
README.md
clone-submodules-no-privlibs.sh
docker-compose.yml
q7s-env-em.sh
q7s-env.sh
release_checklist.md
23 lines
849 B
C++
23 lines
849 B
C++
#include "Timestamp.h"
|
|
|
|
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
|
|
|
|
Timestamp::Timestamp() {
|
|
ReturnValue_t result = Clock::getDateAndTime(&time);
|
|
if (result != returnvalue::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();
|
|
}
|