RealDocs

UKismetMathLibrary::Add_DateTimeDateTime

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Adds two FDateTime values by summing their raw tick counts and returns the result as a new FDateTime. This is an unusual operation with no standard calendar meaning — in most cases you want Add_DateTimeTimespan instead.

Caveats & Gotchas

  • Adding two wall-clock dates (e.g. 2024-01-01 + 2024-06-15) produces a nonsensical result because the tick sum does not correspond to any meaningful date. This function exists for Blueprint operator completeness, not for typical calendar arithmetic.
  • Overflow is likely for any pair of non-trivially small FDateTime values, since tick counts representing real dates are already large int64 values. The result silently wraps when overflow occurs.

Signature

static UE_INL_API FDateTime Add_DateTimeDateTime(FDateTime A, FDateTime B);

Parameters

Name Type Description Default
A FDateTime First date-time operand.
B FDateTime Second date-time operand.

Return Type

FDateTime

Example

Summing tick offsets (unusual use case) C++
// Rarely needed — prefer Add_DateTimeTimespan for shifting dates.
// Use only when both values represent raw tick offsets, not calendar dates.
FDateTime OffsetA(FTimespan::FromHours(2).GetTicks());
FDateTime OffsetB(FTimespan::FromHours(3).GetTicks());
FDateTime Combined = UKismetMathLibrary::Add_DateTimeDateTime(OffsetA, OffsetB);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.