|
@@ -3,7 +3,7 @@
|
|
* Company: Lynar Studios
|
|
* Company: Lynar Studios
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
* Created: 2020-08-14
|
|
* Created: 2020-08-14
|
|
- * Changed: 2023-02-23
|
|
|
|
|
|
+ * Changed: 2023-05-16
|
|
*
|
|
*
|
|
* */
|
|
* */
|
|
|
|
|
|
@@ -15,7 +15,6 @@
|
|
|
|
|
|
using ls::std::core::Class;
|
|
using ls::std::core::Class;
|
|
using ls::std::time::Date;
|
|
using ls::std::time::Date;
|
|
-using std::localtime;
|
|
|
|
using std::put_time;
|
|
using std::put_time;
|
|
using std::string;
|
|
using std::string;
|
|
using std::stringstream;
|
|
using std::stringstream;
|
|
@@ -63,32 +62,32 @@ bool Date::before(const Date &_foreignDate) const
|
|
return this->timestamp < _foreignDate.getTime();
|
|
return this->timestamp < _foreignDate.getTime();
|
|
}
|
|
}
|
|
|
|
|
|
-int Date::getDay()
|
|
|
|
|
|
+int Date::getDay() const
|
|
{
|
|
{
|
|
return this->localTime->tm_mday;
|
|
return this->localTime->tm_mday;
|
|
}
|
|
}
|
|
|
|
|
|
-int Date::getHour()
|
|
|
|
|
|
+int Date::getHour() const
|
|
{
|
|
{
|
|
return this->localTime->tm_hour;
|
|
return this->localTime->tm_hour;
|
|
}
|
|
}
|
|
|
|
|
|
-int Date::getMinute()
|
|
|
|
|
|
+int Date::getMinute() const
|
|
{
|
|
{
|
|
return this->localTime->tm_min;
|
|
return this->localTime->tm_min;
|
|
}
|
|
}
|
|
|
|
|
|
-int Date::getMonth()
|
|
|
|
|
|
+int Date::getMonth() const
|
|
{
|
|
{
|
|
return this->localTime->tm_mon + 1;
|
|
return this->localTime->tm_mon + 1;
|
|
}
|
|
}
|
|
|
|
|
|
-int Date::getSecond()
|
|
|
|
|
|
+int Date::getSecond() const
|
|
{
|
|
{
|
|
return this->localTime->tm_sec;
|
|
return this->localTime->tm_sec;
|
|
}
|
|
}
|
|
|
|
|
|
-int Date::getYear()
|
|
|
|
|
|
+int Date::getYear() const
|
|
{
|
|
{
|
|
return this->localTime->tm_year + 1900;
|
|
return this->localTime->tm_year + 1900;
|
|
}
|
|
}
|
|
@@ -104,7 +103,7 @@ void Date::setTime(time_t _timestamp)
|
|
this->_init();
|
|
this->_init();
|
|
}
|
|
}
|
|
|
|
|
|
-string Date::toString()
|
|
|
|
|
|
+string Date::toString() const
|
|
{
|
|
{
|
|
stringstream _stream{};
|
|
stringstream _stream{};
|
|
_stream << put_time(this->localTime, "%Y-%m-%d %H:%M:%S");
|
|
_stream << put_time(this->localTime, "%Y-%m-%d %H:%M:%S");
|