database functions
This commit is contained in:
8
src/timestamp.cpp
Normal file
8
src/timestamp.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "timestamp.hpp"
|
||||
|
||||
Timestamp ParseTimestamp(const std::string& ts) {
|
||||
std::tm tm = {};
|
||||
std::istringstream ss(ts);
|
||||
ss >> std::get_time(&tm, "%Y-%m-%d %H:%M:%S");
|
||||
return std::chrono::system_clock::from_time_t(std::mktime(&tm));
|
||||
}
|
||||
Reference in New Issue
Block a user