UKismetMathLibrary::GetMinute
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the minute component of A in the range 0–59. Use this alongside GetHour to display or compare time-of-day at minute precision.
Caveats & Gotchas
- • Returns the minute within the current hour (0–59), not total elapsed minutes. To get total minutes since a reference time, subtract the two FDateTime values and use FTimespan::GetTotalMinutes().
- • Leap seconds are not modelled — FDateTime assumes every minute has exactly 60 seconds. Code that attempts to account for real-world leap seconds using this API will be incorrect.
Signature
static UE_INL_API int32 GetMinute( FDateTime A ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FDateTime | The date-time to extract the minute from. | — |
Return Type
int32 Example
Trigger an event at the top of each hour C++
FDateTime Now = FDateTime::UtcNow();
if (UKismetMathLibrary::GetMinute(Now) == 0 &&
UKismetMathLibrary::GetSecond(Now) == 0)
{
FireHourlyEvent();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?