how can i get date of every 7th day from start date for a period of time.
I have a scheduler that is supposed to run at every 7 days after its start datetime is set to send push notification for every time zone.
eg.
start_time run_every end_time
20-july-2016 10:00:00 7_days 25-dec-2016 10:00:00
then i will run scheduler every 7 days from 20-july-2016 at 10 am. that will be 28-july, 4-aug, 11-aug and so on.
The problem is its supposed to be run for all time zones so that user in australia can get notification on 20-july-2016 10:00:00 and user in US should also get notification on 20-july-2016 10:00:00.
for that I am running scheduler on start_date, start_date+1.days, start_date-1.days
because my server is in UTC timezone so that it can occupy 10 am of every timezone.
I cant figure out a way to run it in intervals of 7 days. how can i get next running dates and check every day that should i run this notification today?