Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_parser.hpp File Reference

Header file with functions for parsing dates and times in ISO8601 format and converting them to various timestamp formats. More...

Go to the source code of this file.

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
 

Functions

template<class T = Month>
time_shield::get_month_number (const std::string &month)
 Get the month number by name.
 
template<class T = Month>
time_shield::month_of_year (const std::string &month)
 Alias for get_month_number function.
 
template<class T = Month>
bool time_shield::try_get_month_number (const std::string &month, T &value)
 Get the month number by name, with output parameter.
 
template<class T = Month>
bool time_shield::get_month_number (const std::string &month, T &value)
 Alias for try_get_month_number function.
 
template<class T = Month>
bool time_shield::month_of_year (const std::string &month, T &value)
 Alias for try_get_month_number function.
 
bool time_shield::parse_time_zone (const std::string &tz_str, TimeZoneStruct &tz)
 Parse a time zone string into a TimeZoneStruct.
 
bool time_shield::parse_tz (const std::string &tz_str, TimeZoneStruct &tz)
 Alias for parse_time_zone function.
 
bool time_shield::parse_iso8601 (const std::string &input, DateTimeStruct &dt, TimeZoneStruct &tz)
 Parse a date and time string in ISO8601 format.
 
bool time_shield::str_to_ts (const std::string &str, ts_t &ts)
 Convert an ISO8601 string to a timestamp (ts_t).
 
bool time_shield::str_to_ts_ms (const std::string &str, ts_ms_t &ts)
 Convert an ISO8601 string to a millisecond timestamp (ts_ms_t).
 
bool time_shield::str_to_fts (const std::string &str, fts_t &ts)
 Convert an ISO8601 string to a floating-point timestamp (fts_t).
 
ts_t time_shield::ts (const std::string &str)
 Convert an ISO8601 string to a timestamp (ts_t).
 
ts_ms_t time_shield::ts_ms (const std::string &str)
 Convert an ISO8601 string to a millisecond timestamp (ts_ms_t).
 
fts_t time_shield::fts (const std::string &str)
 Convert an ISO8601 string to a floating-point timestamp (fts_t).
 
template<class T = int>
bool time_shield::sec_of_day (const std::string &str, T &sec)
 Parse time of day string to seconds of day.
 
template<class T = int>
time_shield::sec_of_day (const std::string &str)
 Convert time of day string to seconds of day.
 
ts_t time_shield::ts (const char *str)
 Convert an ISO8601 C-style string to a timestamp (ts_t).
 
ts_ms_t time_shield::ts_ms (const char *str)
 Convert an ISO8601 C-style string to a millisecond timestamp (ts_ms_t).
 
fts_t time_shield::fts (const char *str)
 Convert an ISO8601 C-style string to a floating-point timestamp (fts_t).
 

Detailed Description

Header file with functions for parsing dates and times in ISO8601 format and converting them to various timestamp formats.

This file contains functions for parsing ISO8601 date and time strings, extracting month numbers from month names, and converting parsed date and time information to different timestamp formats.

Definition in file time_parser.hpp.