Commit d217213d authored by Alexander Lapshin's avatar Alexander Lapshin

.

parent 68c5520b
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <sstream> #include <sstream>
#include "globals.h" #include "globals.h"
#include "TextFunctions.h" #include "TextFunctions.h"
#include <chrono>
#include <ctime>
static void GetPrecK(int msprec, int& k1, int& k2) static void GetPrecK(int msprec, int& k1, int& k2)
{ {
...@@ -480,3 +482,14 @@ static std::string calc_nightid(const TimeJD& date, const double lon_deg) ...@@ -480,3 +482,14 @@ static std::string calc_nightid(const TimeJD& date, const double lon_deg)
string_replace(str, "/", ""); string_replace(str, "/", "");
return str; return str;
} }
inline std::string get_current_time(const std::string& format)
{
const auto now = std::chrono::system_clock::now();
auto in_time_t = std::chrono::system_clock::to_time_t(now);
std::stringstream ss;
ss << std::put_time(std::gmtime(&in_time_t), format.c_str());
return ss.str();
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment