I dont have code because I cant work out how to do this. The functional requirement though are these.
1.) Given a year, month, day, hour,minute and second I want to return a timestamp
2.) Given that timestamp I want to add 7 days to it and get the new timestamp.
Can anyone give me an example of how to do it. So in my use case I need to state when an event takes place for the first time. And each day check if the current day is an expected number of days since a specific date.
Are you allowed to use existing libraries to achieve this? Or must you write your own code from scratch? I hope it is the former, because otherwise it can be quite tricky. Converting minutes, hours and days into a timestamp is easy because they are all the same length. But months are not, and years are not either, because of leap years. So not easy, but interesting, I suppose!