Unity iOS - Increase Value Based On Time Inactive

Hi there!
I’m developing an iOS game in Unity that includes a recharging currency. The currency recharges by 1, every minute that the player isn’t playing. How would I go about doing this? Is there a value or function in Unity to get unix (epoch) time? Really if someone can answer that, I can figure out the rest.

Will post with update once I get it working.

For the first scenario - when the game goes into the background, you can get a timestamp from the OnApplicationFocus method (this event fires when the game loses, or receives focus). So as soon as the application loses focus, store the timestamp, then once the game receives focus, subtract the two dates from each other, and use that to calcuate the currency.

You can use the same technique for OnApplicationQuit, just make sure the timestamp is stored in some sort of persistent data store on the mobile device.