UKismetMathLibrary::Less_DateTimeDateTime
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if A is strictly earlier in time than B (A < B). Useful for sorting events or checking that a prerequisite timestamp precedes a target time.
Caveats & Gotchas
- • Returns false when A equals B exactly — use LessEqual_DateTimeDateTime if the equal case should also pass.
- • FDateTime comparison operates on the stored tick count with no calendar awareness. A date constructed with an incorrect year (e.g. off-by-one in month rollover logic) will silently compare incorrectly — validate FDateTime construction separately.
Signature
static UE_INL_API bool Less_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
Sort events by timestamp C++
TArray<FScheduledEvent> Events;
Events.Sort([](const FScheduledEvent& A, const FScheduledEvent& B)
{
return UKismetMathLibrary::Less_DateTimeDateTime(A.Time, B.Time);
}); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?