UKismetMathLibrary::LessEqual_DateTimeDateTime
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if A is earlier than or equal to B (A <= B). Use when you need to verify that an event is scheduled no later than a given deadline.
Caveats & Gotchas
- • The equal case is tick-precise — two FDateTime values obtained from separate FDateTime::UtcNow() calls will virtually never be equal. This function effectively behaves like Less_DateTimeDateTime for real timestamps.
- • When used in Blueprint with the <= node, both input pins default to a zero-initialised FDateTime (year 1, January 1) if not connected. Ensure both pins are wired to avoid always-true comparisons.
Signature
static UE_INL_API bool LessEqual_DateTimeDateTime( FDateTime A, FDateTime B ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FDateTime | The date-time to test. | — |
| B | FDateTime | The date-time to compare against. | — |
Return Type
bool Example
Ensure an event is within a time window C++
FDateTime WindowEnd = GetWindowCloseTime();
FDateTime EventTime = GetPendingEventTime();
if (UKismetMathLibrary::LessEqual_DateTimeDateTime(EventTime, WindowEnd))
{
ScheduleEvent(EventTime);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?