UKismetMathLibrary::Greater_DateTimeDateTime
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if A is strictly later in time than B (A > B). The primary use case is checking whether a deadline or scheduled event has passed.
Caveats & Gotchas
- • Comparing a UTC timestamp against a local-time timestamp produces a meaningless result — FDateTime has no embedded timezone flag. Ensure both values use the same reference (both from FDateTime::UtcNow() or both from FDateTime::Now()).
- • Returns false when A == B (strictly greater, not greater-or-equal). Use GreaterEqual_DateTimeDateTime if you need to treat simultaneous timestamps as passing the check.
Signature
static UE_INL_API bool Greater_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
Check if a timed event has expired C++
FDateTime ExpiryTime = GetEventExpiry();
FDateTime Now = FDateTime::UtcNow();
if (UKismetMathLibrary::Greater_DateTimeDateTime(Now, ExpiryTime))
{
HandleExpiredEvent();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?