UKismetMathLibrary::Add_DateTimeTimespan
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Adds a timespan duration to a date-time value, returning a new FDateTime shifted forward by that amount. Use this to calculate a future point in time from a known timestamp.
Caveats & Gotchas
- • FDateTime stores ticks as int64; adding a very large FTimespan (e.g. thousands of years) can overflow. Validate inputs if they come from untrusted sources.
- • The result is always in UTC if A was in UTC. There is no timezone adjustment — if A represents local time you must handle timezone offsets yourself before or after this call.
Signature
static UE_INL_API FDateTime Add_DateTimeTimespan( FDateTime A, FTimespan B ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FDateTime | The base date and time. | — |
| B | FTimespan | The duration to add. | — |
Return Type
FDateTime Example
Schedule an event 30 minutes from now C++
FDateTime Now = FDateTime::UtcNow();
FTimespan Delay = FTimespan::FromMinutes(30.0);
FDateTime EventTime = UKismetMathLibrary::Add_DateTimeTimespan(Now, Delay); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?