# Having troubles with DateTime in UE5

**URL:** <https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649>\
**Category:** Feedback & Requests\
**Tags:** unreal-engine, UE5-0\
**Created:** [February 27, 2022, 8:57pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649 "2022-02-27T20:57:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Gametist](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@The\_Gametist](https://forums.unrealengine.com/u/The_Gametist)\
**Post date:** [February 27, 2022, 8:57pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/1 "2022-02-27T20:57:37Z")

</div>

Hello devs!

I have a silly problem with time in UE5, and I was hoping you could help me figure out a solution for my problem.

I am currently saving some gameplay sessions with DateTime.Now(). On a later stage, I need to filter out these sessions by time, as I can have my user pick a random interval in a range (1 day, 3 days, 7 days, 14 days, and so on). This was quite straightforward with DateTime operations in UE4, I could have a subtract operation and be done in a second. However, they are currently not working in UE5 preview, I tried to subtract DateTime structs and it simply doesn’t connect the variables with the node itself.

A perfect solution for me would be to use an ISO date, but as far as I know I can only convert from string to DateTime, not the other way around, and I am not sure if I can manually convert it myself.

Is there any solution that comes to your mind? I know I could write the logic to subtract DateTimes myself, but I’d rather avoid that.

Best!

---

<div class="post-metadata">

**Author:** ![killall-q](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killall-q/32/464887_2.png) [@killall-q](https://forums.unrealengine.com/u/killall-q)\
**Post date:** [May 15, 2022, 3:30am UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/2 "2022-05-15T03:30:19Z")

</div>

I’m having the same problem. I have a past DateTime value, and I want to find the difference from DateTime.Now(). How can such a simple thing be impossible in UE5? Internally, they’re just numbers (seconds since epoch start).

Edit: After creating a generic Subtract node, then manually converting the pins to Date Time structs, I get a green checkmark when dragging a DateTime pin over an input. When I release left-click, it fails to connect, and the input pins become Timespan structs instead. However, if I drag to the lower pin first, then the top pin becomes a DateTime struct, while the lower pin becomes a Timespan struct. This allows me to connect a DateTime value to the top pin, while I still can’t connect another DateTime to the lower pin.

Also, Timespan pins cannot be converted to any other type. A fresh node must be created to try again. Definitely buggy.

---

<div class="post-metadata">

**Author:** ![killall-q](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killall-q/32/464887_2.png) [@killall-q](https://forums.unrealengine.com/u/killall-q)\
**Post date:** [May 17, 2022, 6:12am UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/3 "2022-05-17T06:12:43Z")

</div>

I filed a bug report, and a dev replied that this is a known, backlogged bug. It is currently not a priority.

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-135466)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

---

<div class="post-metadata">

**Author:** ![Haikui](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haikui/32/574323_2.png) [@Haikui](https://forums.unrealengine.com/u/Haikui)\
**Post date:** [June 30, 2022, 1:31am UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/4 "2022-06-30T01:31:40Z")

</div>

Old Math Node: ‘UE4 Ctrl+C’ → ‘UE5 CTRL+V’ 🥲

---

<div class="post-metadata">

**Author:** ![OrfWare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/orfware/32/482755_2.png) [@OrfWare](https://forums.unrealengine.com/u/OrfWare)\
**Post date:** [September 12, 2022, 10:06am UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/5 "2022-09-12T10:06:23Z")

</div>

…I can’t believe that… 😡

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [January 31, 2023, 8:13pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/6 "2023-01-31T20:13:02Z")

</div>

> [@Haikui](#):
>
> Old Math Node: ‘UE4 Ctrl+C’ → ‘UE5 CTRL+V’ 🥲

Clever! here’s the text based version so you can copy/paste this:

```auto
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_18"
   bIsPureFunc=True
   FunctionReference=(MemberParent=Class'"/Script/Engine.KismetMathLibrary"',MemberName="Subtract_DateTimeDateTime")
   NodePosX=0
   NodePosY=0
   NodeGuid=8DF6E69546B319D0DEE8F7920E91D78B
   CustomProperties Pin (PinId=1A250D1E4FB1C43E3D0D498086F9A06C,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=Class'"/Script/Engine.KismetMathLibrary"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultObject="/Script/Engine.Default__KismetMathLibrary",PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=94AA18E74C77A6C3AD17D8B7C12893D9,PinName="A",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/CoreUObject.DateTime"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_17 4485BCFD43F6B8E49F2B1CB2C1FECE4B,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=BC81FBF0483C71486EA364A71267A24B,PinName="B",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/CoreUObject.DateTime"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=E791466840C71DCF3E0B4A89BC5994DA,PinName="ReturnValue",Direction="EGPD_Output",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/CoreUObject.Timespan"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object

```

---

<div class="post-metadata">

**Author:** ![MNijhof](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MNijhof](https://forums.unrealengine.com/u/MNijhof)\
**Post date:** [February 20, 2023, 8:00pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/7 "2023-02-20T20:00:37Z")

</div>

Same issue almost a year later… Any known workarounds?

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [February 20, 2023, 11:59pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/8 "2023-02-20T23:59:55Z")

</div>

Select all the text in the box in the post above this (Text Based Version), ctrl+C, then ctrl+V into your blueprint…

---

<div class="post-metadata">

**Author:** ![Skowroshima](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skowroshima/32/493792_2.png) [@Skowroshima](https://forums.unrealengine.com/u/Skowroshima)\
**Post date:** [May 2, 2023, 4:37pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/9 "2023-05-02T16:37:24Z")

</div>

> [@RecourseDesign](#):
>
> Clever! here’s the text based version so you can copy/paste this:

Wow, still an issue. Thanks for the text to copy/paste as the work around!

---

<div class="post-metadata">

**Author:** ![WhaleFood](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/whalefood/32/725258_2.png) [@WhaleFood](https://forums.unrealengine.com/u/WhaleFood)\
**Post date:** [July 4, 2023, 9:52pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/10 "2023-07-04T21:52:27Z")

</div>

How is this still not fixed in 5.2? Pretty nuts. But thanks for the copy/paste!

---

<div class="post-metadata">

**Author:** ![Keena](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Keena](https://forums.unrealengine.com/u/Keena)\
**Post date:** [August 29, 2023, 2:46pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/12 "2023-08-29T14:46:24Z")

</div>

Ridiculous this is still not fixed, yet, after more over 2 years…

@RecourseDesign, thank you very much for the tip and the provided c/p

---

<div class="post-metadata">

**Author:** ![GBerod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GBerod](https://forums.unrealengine.com/u/GBerod)\
**Post date:** [January 5, 2024, 12:37pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/14 "2024-01-05T12:37:10Z")

</div>

That’s so nice! I copy here the ADD node, which also causes problems, at least to me, just in case someone needs it.

```auto
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_1"
   bIsPureFunc=True
   FunctionReference=(MemberParent=Class'"/Script/Engine.KismetMathLibrary"',MemberName="Add_DateTimeDateTime")
   NodePosX=768
   NodePosY=496
   NodeGuid=A88E194C41CBDDB37BBF6280BEAEEC29
   CustomProperties Pin (PinId=CAB55EEB4B130D019609D8AD54D0BDD4,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target\nKismet Math Library Object Reference",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=Class'"/Script/Engine.KismetMathLibrary"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultObject="/Script/Engine.Default__KismetMathLibrary",PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=857A1C2F445DFD69E1969E8BD73A4886,PinName="A",PinToolTip="A\nDate Time Structure",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/CoreUObject.DateTime"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=AAA5619943B3A5326D91D2B7E7A5004B,PinName="B",PinToolTip="B\nDate Time Structure",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/CoreUObject.DateTime"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=682CD96144DF5017A1FA41A0F78D47A2,PinName="ReturnValue",PinToolTip="Return Value\nDate Time Structure\n\nAddition (A + B)",Direction="EGPD_Output",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/CoreUObject.DateTime"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object

```

---

<div class="post-metadata">

**Author:** ![Jallumearth](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jallumearth/32/768470_2.png) [@Jallumearth](https://forums.unrealengine.com/u/Jallumearth)\
**Post date:** [April 25, 2024, 12:12pm UTC](https://forums.unrealengine.com/t/having-troubles-with-datetime-in-ue5/502649/15 "2024-04-25T12:12:11Z")

</div>

Cheers for this! This was a lifesaver for my project
