void UKismetMathLibrary::BreakDateTime(FDateTime InDateTime, int32& Year, int32& Month, int32& Day, int32& Hour, int32& Minute, int32& Second, int32& Millisecond) { Year = GetYear(InDateTime); Month = GetMonth(InDateTime); Day = GetDay(InDateTime); Hour = GetHour(InDateTime); Minute = GetMinute(InDateTime); Second = GetSecond(InDateTime); Millisecond = GetMillisecond(InDateTime); }
FString FDateTime::ToString( const TCHAR* Format ) const { FString Result; if (Format != nullptr) { while (*Format != TCHAR('\0')) { if ((*Format == TCHAR('%')) && (*(++Format) != TCHAR('\0'))) { switch (*Format) { case TCHAR('a'): Result += IsMorning() ? TEXT("am") : TEXT("pm"); break; case TCHAR('A'): Result += IsMorning() ? TEXT("AM") : TEXT("PM"); break; case TCHAR('d'): Result += FString::Printf(TEXT("%02i"), GetDay()); break; case TCHAR('D'): Result += FString::Printf(TEXT("%03i"), GetDayOfYear()); break; case TCHAR('m'): Result += FString::Printf(TEXT("%02i"), GetMonth()); break; case TCHAR('y'): Result += FString::Printf(TEXT("%02i"), GetYear() % 100); break; case TCHAR('Y'): Result += FString::Printf(TEXT("%04i"), GetYear()); break; case TCHAR('h'): Result += FString::Printf(TEXT("%02i"), GetHour12()); break; case TCHAR('H'): Result += FString::Printf(TEXT("%02i"), GetHour()); break; case TCHAR('M'): Result += FString::Printf(TEXT("%02i"), GetMinute()); break; case TCHAR('S'): Result += FString::Printf(TEXT("%02i"), GetSecond()); break; case TCHAR('s'): Result += FString::Printf(TEXT("%03i"), GetMillisecond()); break; default: Result += *Format; } } else { Result += *Format; } // move to the next one Format++; } } return Result; }