UKismetMathLibrary::NotEqual_DateTimeDateTime
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if two FDateTime values do not represent the same point in time. Equivalent to !(A == B) at tick precision.
Caveats & Gotchas
- • Two timestamps obtained from successive FDateTime::UtcNow() calls will almost always be not-equal, even if called milliseconds apart, because the system clock advances between calls.
- • This is a tick-exact comparison. Two dates that represent the same calendar day but differ by even one tick will return true — use date-component comparisons (GetDay, GetMonth, GetYear) if you want day-level equality.
Signature
static UE_INL_API bool NotEqual_DateTimeDateTime( FDateTime A, FDateTime B ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FDateTime | First date-time to compare. | — |
| B | FDateTime | Second date-time to compare. | — |
Return Type
bool Example
Detect a changed timestamp C++
FDateTime LastChecked = GetLastCheckedTime();
FDateTime Now = FDateTime::UtcNow();
if (UKismetMathLibrary::NotEqual_DateTimeDateTime(LastChecked, Now))
{
RefreshData();
SetLastCheckedTime(Now);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?