Calculating Accurate Time Difference Across Months for Coin Farming

Hello everyone who is reading this post. I have problem with game I develop. Player has to manage characters to farm coins. Coins could be farmed even when game is closed. To my mind the easiest way to do that just count the time difference between now(player opens the game) and the last time when player closed the game. Everything is fine when player starts the game after some time, but when the date passes to the next month time difference counts incorectly. So how could I take into consideration that month changed?

I guess you looking for DateTime - DateTime:

Note that according to Unreal Engine Issues and Bug Tracker (UE-135466) it was broken in engine versions from 5.0 to 5.2

Thank you for your answer. I downloaded older version (4.27) of UE and did it in there because it works in older versions. After that I copied this substraction into my current project and it seems that it works.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.