satdump/src-core/utils/time.h

30 lines
655 B
C
Raw Permalink Normal View History

2025-05-26 19:21:10 +01:00
#pragma once
/**
* @file time.h
2025-05-27 18:42:18 +01:00
* @brief A collection of time-related utility functions
2025-05-26 19:21:10 +01:00
*/
#include <string>
namespace satdump
{
/**
* @brief Get high-precision current UNIX
* time (milliseconds-level).
*
* @return UNIX timestamps in seconds
*/
double getTime();
/**
* @brief Format an unit timestamp to
* string.
*
* @param timestamp UNIX Timestamps in seconds
* @param local format to local time. UTC (false)
* by default
* @return String in YYYY/MM/DD HH:MM:SS format
*/
std::string timestamp_to_string(double timestamp, bool local = false);
} // namespace satdump