123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2020-08-14
- * Changed: 2020-08-21
- *
- * */
- #ifndef DATE_HPP
- #define DATE_HPP
- #include "../base/Class.hpp"
- #include <ctime>
- namespace ls_std {
- class Date : public Class {
- public:
- Date();
- ~Date() = default;
- // arithmetic operators
- Date& operator+(int _value);
- Date& operator-(int _value);
- // additional functionality
- bool after(const Date& _foreignDate) const;
- bool before(const Date& _foreignDate) const;
- int getDay();
- int getHour();
- int getMinute();
- int getMonth();
- int getSecond();
- time_t getTime() const;
- int getYear();
- void setTime(time_t _timestamp);
- std::string toString();
- private:
- time_t timestamp {};
- tm* localTime {};
- void _init();
- };
- }
- #endif
|