I'm creating a program which only can do a certain thing once per day.
This means that I have to be able to find out whether this has been done "today". I'm not sure how to do this, but I thought of something like this:
1. Get current date or something similar.
2. Save it to database or whatever.
3. Next time this is attempted, then read from database, get current date again and figure out if one day has passed.
How can I compare two dates to see if there is atleast one day difference?
Atleast see if the day of month is the same in both dates or not.
This is probably not a complicated task, but I don't know where to begin ...
Thanks in advance!