Daily Rewards?

How would one do daily rewards? I just want to give my players some coins daily.

When a player joins simply store the current UNIX Time + 86400 (1 day in seconds) in a text file or database and when the player re-joins simply check if the current UNIX time is bigger than the stored one, if so give the reward then update the time with the current UNIX Time + 86400.

If you want it to be more based on “days” rather than joining 24 hours + 1 second after each connect to get the reward ( which will shift ), you can easily grab the timestamp from the current day at midnight and add the 86400 which means the player can join every midnight and grab the reward, or anytime during the day. This means the player isn’t required to keep a “schedule” and can join when they want to to receive the reward ( which can lead to server remaining full at more hours because if you give a treat for coming but not unless they maintain a schedule it may upset people ).