Skip to content

Commit

Permalink
feat: LLBC_Timepan::ToString()打印格式标准化: DD HH:MM:SS.MicroSeconds
Browse files Browse the repository at this point in the history
  • Loading branch information
lailongwei committed Jan 6, 2025
1 parent 85b7615 commit 4ca0093
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions llbc/include/llbc/core/time/TimeSpanInl.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,8 @@ inline LLBC_TimeSpan &LLBC_TimeSpan::operator=(const LLBC_TimeSpan &span)

inline LLBC_String LLBC_TimeSpan::ToString() const
{
int days = GetDays();
if (days != 0)
return LLBC_String().format("%d %02d:%02d:%02d.%06d",
days, GetHours(), GetMinutes(), GetSeconds(), GetMillis() * 1000 + GetMicros());
else
return LLBC_String().format("%02d:%02d:%02d.%06d",
GetHours(), GetMinutes(), GetSeconds(), GetMillis() * 1000 + GetMicros());
return LLBC_String().format("%02d %02d:%02d:%02d.%06d",
GetDays(), GetHours(), GetMinutes(), GetSeconds(), GetMillis() * 1000 + GetMicros());
}

inline void LLBC_TimeSpan::Serialize(LLBC_Stream &stream) const
Expand Down

0 comments on commit 4ca0093

Please sign in to comment.