UKismetMathLibrary::GetMinutes
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the minutes component of the timespan (whole minutes remaining after extracting full hours). Range is -59 to +59.
Caveats & Gotchas
- • This is the minutes *component*, not total minutes — a 90-minute timespan returns 30 (with GetHours returning 1). For total minutes call FTimespan::GetTotalMinutes() in C++.
- • For negative timespans the value will be in the range -59 to 0.
Signature
static UE_INL_API int32 GetMinutes( FTimespan A ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FTimespan | The timespan to query. | — |
Return Type
int32 Example
Build an MM:SS countdown string C++
FTimespan Remaining = Deadline - FDateTime::UtcNow();
int32 Min = UKismetMathLibrary::GetMinutes(Remaining);
int32 Sec = UKismetMathLibrary::GetSeconds(Remaining);
FString Countdown = FString::Printf(TEXT("%02d:%02d"), Min, Sec); Tags
Version History
Introduced in: 4.7
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?