Adding timespan to date time not working

Trying to add a date/time and a timespan with the DateTime + Timespan node per the documentation.

When I connect a timespan value into the B pin of the addition node, Unreal automatically converts the node into a Timespan + Timespan node.

bp

I assume this is a UE5 bug. If so, is there any way I can turn off this auto-conversion until it’s fixed? Or perhaps I am just doing something wrong?

1 Like

I’m having this exact issue. UE5.0_EA

the problem still exists in UE5.0_P2

I have tried to add a datetime to a datetime, it is not working as well. The convert pin menu is not opening for the input pins. If you add another input pin, there will be a datetime, a timespan and another datetime pin created, which can be connected to two datetimes. But shows error on compile.
UE5 Preview2

P.S: Today I compiled an Editor from 5.0 branch, the problems still exist.

1 Like

Hi,

Here is a combination that could help:

Best

2 Likes

FDateTime+FTimespan was able to work in C++
image

So I add a BlueprintFunctionLibrary function:

1 Like

still exists in UE 5.0.3

Still exists in 5.1.0

1 Like

To add the seconds you can use that function in C++, with FTimespan methods.

FDateTime UTestFuncLib::AddSeconds(FDateTime StartFrom, int TimeToAdd)
{
FTimespan DataTimeTemp = FTimespan::FromSeconds(TimeToAdd);

return  StartFrom + DataTimeTemp;

}

I tried this today and it worked good for me, simply connecting the the Date Time Struct and using the split struct in the other node.

image

1 Like

Still happening in UE 5.2.1 :frowning: I found some doc page from UE 4.27 and it seems that there was a DateTime + Timespan node allowing you to add a timespan on top of a datetime (which sounds logical, as timespans not being able to offset datetimes are pretty useless by their own), but apparently that node is nowhere to be found in UE5 docs…

i have noticed that we can copy this node from ue4 and it works :smiley:

2 Likes

Copying over from UE4 worked for me too, thanks so much :slight_smile:

np :smiley:


This worked for me in 5.2
Thanks, reddit user dustinin!

1 Like

Still a problem for me in 5.3.2. Dustini’s advice didn’t help me I’m afraid.
Edit: Found a workaround by converting everything to seconds and adding it up. Here’s how it looks if it helps anyone