# DateTime as UTC Only

**URL:** <https://forums.unrealengine.com/t/datetime-as-utc-only/391051>\
**Category:** Blueprint\
**Tags:** time, unreal-engine, UE4, Blueprint, question\
**Created:** [April 16, 2017, 11:28am UTC](https://forums.unrealengine.com/t/datetime-as-utc-only/391051 "2017-04-16T11:28:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_6ed0a361](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6ed0a361](https://forums.unrealengine.com/u/anonymous_user_6ed0a361)\
**Post date:** [April 16, 2017, 11:28am UTC](https://forums.unrealengine.com/t/datetime-as-utc-only/391051/1 "2017-04-16T11:28:10Z")

</div>

I’m currently messing around with the engine and wanted to create a small blueprint that handles the date and time in game. I want to work out the date and time based on a static start date + however long the game/server has been running.

I have this working, but because of the timezone my time is not what I want.

Basically I have a DateTime variable in which I specify a static date (example: 2017.01.01 09.00.00 +0200), but it will automatically add +0200 at the end since that is the timezone I’m in. This means that the time I show on the HUD is off by 2 hours compared to what I set the variable.

There is a function that will return the date and time as UTC as Text, but I want a DateTime object as UTC and not a string/text representation so I can do calculations on the UTC date and time.

I don’t care about the local time in this case. I just want to be able to set a DateTime variable to a specific date without it automatically being convert to my local timezone.

I assume this is simple in C++, but how do you do it in blueprints?

Regards

---

<div class="post-metadata">

**Author:** ![Sn\_a\_ke](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sn\_a\_ke](https://forums.unrealengine.com/u/Sn_a_ke)\
**Post date:** [November 25, 2018, 9:13pm UTC](https://forums.unrealengine.com/t/datetime-as-utc-only/391051/2 "2018-11-25T21:13:15Z")

</div>

Engine\Source\Editor\DetailCustomizations\Private\DateTimeStructCustomization.cpp

FDateTimeStructCustomization::ParseDateTimeZone(const FString& DateTimeZoneString, FDateTime& OutDateTime)

In this method, hardcoded timezone. I have no idea why an arbitrary structure is tied to local time.

if you do not use UPROPERTY(BlueprintReadWrite) of this structure, but declare it in c ++, then the DateTimeStructCustomization methods do not work and the structure can be used normally without a timezone.

you just need it not to be configured directly in the editor.  
I think this is a BUG.

---

<div class="post-metadata">

**Author:** ![Cucharon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cucharon](https://forums.unrealengine.com/u/Cucharon)\
**Post date:** [December 27, 2018, 1:53pm UTC](https://forums.unrealengine.com/t/datetime-as-utc-only/391051/3 "2018-12-27T13:53:26Z")

</div>

There is any way to use this functions in C++? I’m not sure how to import it.

---

<div class="post-metadata">

**Author:** ![Clampy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Clampy](https://forums.unrealengine.com/u/Clampy)\
**Post date:** [December 27, 2018, 7:08pm UTC](https://forums.unrealengine.com/t/datetime-as-utc-only/391051/4 "2018-12-27T19:08:26Z")

</div>

There are global functions called Now() and UtcNow(), would either of these help you?

---

<div class="post-metadata">

**Author:** ![Light\_Shock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/light_shock/32/1194530_2.png) [@Light\_Shock](https://forums.unrealengine.com/u/Light_Shock)\
**Post date:** [June 12, 2022, 11:04am UTC](https://forums.unrealengine.com/t/datetime-as-utc-only/391051/5 "2022-06-12T11:04:46Z")

</div>

I just hit this problem and am posting a fix for those who follow. There is an editor option called “Display Timezone” - if you set this to UTC it will zero out the time zone value.
