How can I get the current system time and date?
I can´t seem to find a function for it and the link to the UE4 documentation just leads me to a 404 page.
Hi!
You can do this in two ways
1. Install plugin Victory.
Get Current Operating System Time
2. Or add C++ class
That plugin is for Unreal Engine 4.7, but im already on 4.8.
And on the C++ class link, the link to docs.unrealengine doesn’t work, so I can’t look up the function.
I did, and it doesn’t work:
I installed it like it says on the page.
Any idea why its not working?
Note that the above answer is now outdated. You can simply use the Blueprint node “Now” along with the built in “DateTime” nodes to achieve the results requested.
You sir, have won the day for me. It’s nice that there’s someone who enters old questions and updates them with new info. Good job
My thx !!!
And then you can use the asDate
blueprint node to convert it to text, if needed.
The plugin is only available for the windows platform.
As previously stated, you can simply use the Blueprint node “Now” along with the built in “DateTime” nodes to achieve the results requested.
In C++ you can use FDateTime::Now().
For example, to get the current day of the year:
const int32 CurrentDay = FDateTime::Now().GetDayOfYear();
You can use the Timespan and Date Time functions.
Aaagh, I just spent an hr writing a function do that! lol! Oh well! :o)