|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2020-08-14
|
|
|
- * Changed: 2023-05-16
|
|
|
+ * Changed: 2023-05-19
|
|
|
*
|
|
|
* */
|
|
|
|
|
@@ -64,32 +64,32 @@ bool Date::before(const Date &_foreignDate) const
|
|
|
|
|
|
int Date::getDay() const
|
|
|
{
|
|
|
- return this->localTime->tm_mday;
|
|
|
+ return this->localTime.tm_mday;
|
|
|
}
|
|
|
|
|
|
int Date::getHour() const
|
|
|
{
|
|
|
- return this->localTime->tm_hour;
|
|
|
+ return this->localTime.tm_hour;
|
|
|
}
|
|
|
|
|
|
int Date::getMinute() const
|
|
|
{
|
|
|
- return this->localTime->tm_min;
|
|
|
+ return this->localTime.tm_min;
|
|
|
}
|
|
|
|
|
|
int Date::getMonth() const
|
|
|
{
|
|
|
- return this->localTime->tm_mon + 1;
|
|
|
+ return this->localTime.tm_mon + 1;
|
|
|
}
|
|
|
|
|
|
int Date::getSecond() const
|
|
|
{
|
|
|
- return this->localTime->tm_sec;
|
|
|
+ return this->localTime.tm_sec;
|
|
|
}
|
|
|
|
|
|
int Date::getYear() const
|
|
|
{
|
|
|
- return this->localTime->tm_year + 1900;
|
|
|
+ return this->localTime.tm_year + 1900;
|
|
|
}
|
|
|
|
|
|
time_t Date::getTime() const
|
|
@@ -106,7 +106,7 @@ void Date::setTime(time_t _timestamp)
|
|
|
string Date::toString() const
|
|
|
{
|
|
|
stringstream _stream{};
|
|
|
- _stream << put_time(this->localTime, "%Y-%m-%d %H:%M:%S");
|
|
|
+ _stream << put_time(&this->localTime, "%Y-%m-%d %H:%M:%S");
|
|
|
|
|
|
return _stream.str();
|
|
|
}
|
|
@@ -123,5 +123,5 @@ void Date::_incrementByDays(int _value)
|
|
|
|
|
|
void Date::_init()
|
|
|
{
|
|
|
- this->localTime = localtime(&this->timestamp);
|
|
|
+ localtime_r(&this->timestamp, &this->localTime);
|
|
|
}
|