openMSX
Date.hh
Go to the documentation of this file.
1 #ifndef DATE_HH
2 #define DATE_HH
3 
4 #include <limits>
5 #include <string>
6 #include <ctime>
7 
8 namespace openmsx::Date {
9 
11 
12  // Convert INVALID_TIME_T to a different (close) value.
13  inline time_t adjustTimeT(time_t time) {
14  return (time == Date::INVALID_TIME_T) ? (Date::INVALID_TIME_T + 1)
15  : time;
16  }
17 
18  // 'p' must point to a buffer that is at least 24 characters long
19  [[nodiscard]] time_t fromString(const char* p);
20 
21  [[nodiscard]] std::string toString(time_t time);
22 
23 } // namespace openmsx::Date
24 
25 #endif
gl::min
vecN< N, T > min(const vecN< N, T > &x, const vecN< N, T > &y)
Definition: gl_vec.hh:274
openmsx::Date::INVALID_TIME_T
constexpr time_t INVALID_TIME_T
Definition: Date.hh:10
openmsx::Date::fromString
time_t fromString(const char *p)
Definition: Date.cc:29
openmsx::Date::toString
std::string toString(time_t time)
Definition: Date.cc:150
openmsx::Date::adjustTimeT
time_t adjustTimeT(time_t time)
Definition: Date.hh:13
openmsx::Date
Definition: Date.cc:5