Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Seeking Clarity on Timestamp Discrepancy: Comparing EconomyService's Player Balance Updates

Discussion in 'Economy' started by senatin, Dec 2, 2023.


Is there a method to retrieve the most recent date when the player's economy balance was last update


    0 vote(s)
  2. economy playerbalance

    0 vote(s)
  1. senatin


    Jul 6, 2015
    I wanted to compare the last time my specific player balance was updated using this script:

    Code (CSharp):
    1. {
    2.    PlayerBalance playerBalance = await GetEconomyBalance(//provided CurrencyDefinition);
    3.    return playerBalance.Modified.Date;
    4. }
    6. private async Task<PlayerBalance> GetEconomyBalance(CurrencyDefinition currentData)
    7. {
    8.    return await currentData.GetPlayerBalanceAsync();
    9. }
    Initially, I believed that the Modified property contained the information I was looking for. However, I noticed a discrepancy between the output from my script (e.g., 12/2/2023 8:20:30 PM) and the last update timestamp shown on the cloud dashboard (e.g., Dec 3, 2023 4:20 AM GMT+8).

    To address this, I am considering using cloud save functionality to store the date for comparison. However, I want to ensure that I am not overlooking any details, such as the impact of GMT, that might explain the differences. I have explored various resources but couldn't find a more comprehensive explanation. Any insights or guidance on this matter would be greatly appreciated.