mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 07:45:46 +00:00
Fix datetime bug with timespan using spaces instead of zeros
This commit is contained in:
@@ -135,5 +135,8 @@ namespace Tesses::Framework::Date
|
||||
{
|
||||
return dt.ToEpoch() - dt2.ToEpoch();
|
||||
}
|
||||
|
||||
inline TimeSpan operator-(const TimeSpan& ts, const TimeSpan& ts2)
|
||||
{
|
||||
return ts.TotalSeconds() - ts2.TotalSeconds();
|
||||
}
|
||||
};
|
||||
@@ -861,7 +861,7 @@ namespace Tesses::Framework::Date
|
||||
//hours must force multi digit minutes
|
||||
str += std::to_string(this->Hours());
|
||||
str += ":";
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Minutes()),2,' ');
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Minutes()),2,'0');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -869,7 +869,7 @@ namespace Tesses::Framework::Date
|
||||
}
|
||||
|
||||
str += ":";
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Seconds()),2,' ');
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Seconds()),2,'0');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -882,11 +882,11 @@ namespace Tesses::Framework::Date
|
||||
str += ".";
|
||||
}
|
||||
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Hours()),2,' ');
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Hours()),2,'0');
|
||||
str += ":";
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Minutes()),2,' ');
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Minutes()),2,'0');
|
||||
str += ":";
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Seconds()),2,' ');
|
||||
str += Http::HttpUtils::LeftPad(std::to_string(this->Seconds()),2,'0');
|
||||
|
||||
}
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user