Fixed checkAndCutOffDateWithSec to work with AM/PM
parent
f9e7f78787
commit
3bec0edebc
|
|
@ -209,6 +209,10 @@ public:
|
|||
// <FS:Ansariel> Seconds in timestamps
|
||||
void checkAndCutOffDateWithSec(std::string& time_str)
|
||||
{
|
||||
if (time_str.size() < 10) // not enough space for a date
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Cuts off the "%Y/%m/%d" from string for todays timestamps.
|
||||
// Assume that passed string has at least "%H:%M:%S" time format.
|
||||
date log_date(not_a_date_time);
|
||||
|
|
@ -225,20 +229,12 @@ public:
|
|||
|
||||
if ( days_alive == zero_days )
|
||||
{
|
||||
// Yep, today's so strip "%Y/%m/%d" info
|
||||
ptime stripped_time(not_a_date_time);
|
||||
|
||||
mTimeSecStream.str(LLStringUtil::null);
|
||||
mTimeSecStream << time_str;
|
||||
mTimeSecStream >> stripped_time;
|
||||
mTimeSecStream.clear();
|
||||
|
||||
time_str.clear();
|
||||
|
||||
mTimeSecStream.str(LLStringUtil::null);
|
||||
mTimeSecStream << stripped_time;
|
||||
mTimeSecStream >> time_str;
|
||||
mTimeSecStream.clear();
|
||||
size_t pos = time_str.find_first_of(' ');
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
time_str.erase(0, pos + 1);
|
||||
LLStringUtil::trim(time_str);
|
||||
}
|
||||
}
|
||||
|
||||
LL_DEBUGS("LLChatLogParser")
|
||||
|
|
|
|||
Loading…
Reference in New Issue