title: Using Time Package to rollover to following Weekday
body: <p>I control a service that has the ability to store Weekday -> Time (also in time.Time format) into a MongoDB for events in a community. The problem I am currently having is trying to rollover these weekdays to the following.</p>
  
  <p>Say every Wednesday at 12:00 there is an event. Once the current weekday is Thursday- I need to roll the time object to the following week at 12:00 Wednesday and store it.</p>
  
  <p>There is no ticking timer. When someone attempts to query all of the current events- I would like for it to check if the event has passed, and if so, update to the next one and display the current. If I was using a persistent timer, the rollover would be easy by just adding 7 days to time.AddDate() or time.Date().</p>
  
  <p>So far I've tried converting the weekday to integers (I'm aware time.Weekday() does this already) then performing math to try to get the amount of days. Then using time.Date() to set the next occurrence. Current: <a href="https://play.golang.org/p/aCNpnhW2Ig" rel="nofollow noreferrer">The Go Playground</a></p>
  
  <p>I have a huge headache and I think I am overthinking and missing something super simple. I've checked the <a href="https://golang.org/pkg/time/" rel="nofollow noreferrer">time package</a> documentation and nothing really popped out for me. I'm not worried about printing or storing the data, just getting the proper calculations and manipulating the time package.</p>