FString FTimespan::ToString( const TCHAR* Format ) const { FString Result; while (*Format != TCHAR('\0')) { if ((*Format == TCHAR('%')) && (*++Format != TCHAR('\0'))) { switch (*Format) { case TCHAR('n'): if (Ticks < 0) Result += TCHAR('-'); break; case TCHAR('N'): Result += (Ticks < 0) ? TCHAR('-') : TCHAR('+'); break; case TCHAR('d'): Result += FString::Printf(TEXT("%i"), FMath::Abs(GetDays())); break; case TCHAR('h'): Result += FString::Printf(TEXT("%02i"), FMath::Abs(GetHours())); break; case TCHAR('m'): Result += FString::Printf(TEXT("%02i"), FMath::Abs(GetMinutes())); break; case TCHAR('s'): Result += FString::Printf(TEXT("%02i"), FMath::Abs(GetSeconds())); break; case TCHAR('f'): Result += FString::Printf(TEXT("%03i"), FMath::Abs(GetMilliseconds())); break; case TCHAR('D'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalDays())); break; case TCHAR('H'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalHours())); break; case TCHAR('M'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalMinutes())); break; case TCHAR('S'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalSeconds())); break; case TCHAR('F'): Result += FString::Printf(TEXT("%f"), FMath::Abs(GetTotalMilliseconds())); break; default: Result += *Format; } } else { Result += *Format; } ++Format; } return Result; }
// Gets number of minutes that have passed since last hour. DWORD CMMTimer::GetCurrentMinutes() const { return GetTotalMinutes() - GetTotalHours() * MINUTES_PER_HOUR; }
LONG CMSTimeSpan::GetSeconds() const throw() { return( LONG( GetTotalSeconds()-(GetTotalMinutes()*60) ) ); }
// Gets number of seconds that have passed since last minute. DWORD CMMTimer::GetCurrentSeconds() const { return GetTotalSeconds() - GetTotalMinutes() * SECONDS_PER_MINUTE; }
// Gets total number of hours that have passed since this timer began. DWORD CMMTimer::GetTotalHours() const { return GetTotalMinutes() / MINUTES_PER_HOUR; }
long sltimespan::GetSeconds() const throw() { return( long( GetTotalSeconds()-(GetTotalMinutes()*60) ) ); }
long sltimespan::GetMinutes() const throw() { return( long( GetTotalMinutes()-(GetTotalHours()*60) ) ); }
LONG MightyTimeSpan::GetMinutes() const throw() { return( LONG( GetTotalMinutes()-(GetTotalHours()*60) ) ); }