radarlib 1.4.6
time.hpp File Reference

Functions about times and dates. More...

#include <ctime>
#include <string>
#include <stdexcept>
#include <radarlib/defs.h>

Go to the source code of this file.

Namespaces

namespace  Radar::timeutils
 Functions about times and dates.
 

Functions

time_t Radar::timeutils::getUTC ()
 Get the current UTC time from the system.
 
time_t Radar::timeutils::mktime (int year, int month, int day)
 Create a time from a date.
 
time_t Radar::timeutils::mktime (int year, int month, int day, int hour, int min, int sec)
 Create a time from a date.
 
double Radar::timeutils::mktime (int year, int month, int day, int hour, int min, int sec, int msec)
 Create a time from a date.
 
bool Radar::timeutils::isValidDate (int year, int month, int day)
 Check if the specified date is a valid date.
 
bool Radar::timeutils::isValidTime (int hour, int min, int sec)
 Check if the specified time is a valid date.
 
void Radar::timeutils::splitYMD (time_t absolute, int &year, int &month, int &day)
 Extract date informations from a time_t value.
 
void Radar::timeutils::splitYMD (double absolute, int &year, int &month, int &day)
 Extract date informations from a double value.
 
void Radar::timeutils::splitHMS (time_t absolute, int &hour, int &min, int &sec)
 Extract day time informations from a time_t value.
 
void Radar::timeutils::splitHMS (double absolute, int &hour, int &min, int &sec, int &msec)
 Extract day time informations from a double value.
 
void Radar::timeutils::splitYMDHMS (time_t absolute, int &year, int &month, int &day, int &hour, int &min, int &sec)
 Extract date and day time informations from a time_t value.
 
void Radar::timeutils::splitYMDHMS (double absolute, int &year, int &month, int &day, int &hour, int &min, int &sec, int &msec)
 Extract date and day time informations from a double value.
 
std::string Radar::timeutils::absoluteToString (time_t value)
 , const char* fmt)
 
std::string Radar::timeutils::absoluteToString (double value, bool allowNAN)
 Convert an double value representing an absolute time_t value with milliseconds.
 
time_t Radar::timeutils::parseYYYYMMDDHHMMSS (const std::string &str)
 Convert a string to a time_t value.
 
time_t Radar::timeutils::toEpoch (float absolute)
 Reduce a float value to a time_t value, truncating the milliseconds.
 
time_t Radar::timeutils::toEpoch (double absolute)
 Reduce a double value to a time_t value, truncating the milliseconds.
 
time_t Radar::timeutils::extractDate (time_t absolute)
 Extract the date from a time_t value to a new time_t value.
 
double Radar::timeutils::extractDate (double absolute)
 Extract the date from a double value to a new double value.
 
time_t Radar::timeutils::extractTime (time_t absolute)
 Extract the day time from a time_t value to a new time_t value.
 
double Radar::timeutils::extractTime (double absolute)
 Extract the day time from a double value to a new double value.
 
std::string Radar::timeutils::dayTimeToStr (time_t value)
 Convert a day time to a string.
 
std::string Radar::timeutils::dayTimeToStr (double value)
 Convert a day time with milliseconds to a string.
 
void Radar::timeutils::convertYday (int year, int yday, int &month, int &day)
 Convert a year day to the corresponding month and day number.
 
time_t Radar::timeutils::convertYday (int year, int yday)
 Convert a year day to the corresponding time_t value.
 
int Radar::timeutils::mkYday (int year, int month, int day)
 Calculate the year day from a date.
 

Detailed Description

Functions about times and dates.