Tuesday 17 September 2013

[dcphp-dev] Repeating pattern incongruent to any calendar increment

I'm trying to think of a better means of determining a set of values for "today" based on a repeating pattern.

I have this schedule that follows a repeating pattern of blocks of 70 days (10 weeks). 70 doesn't map to anything useful in a calendar year, and there is no logical way I see of deriving today's schedule from the date without a fixed reference in history. I can take an arbitrary historical date and assign it a position within the 70-day pattern, then query and calculate the series of schedules in contemporary time from start date to end date, but that seems frivolous to reference a date that far into history.

Alternatively, I could calculate and cache a set of reference points (position 1 in every block of 70, e.g.) and compare today's date to select the date closest to today's date and advance the pattern from there.

Perhaps I'm thinking about this wrong though. Is there a numerical date system (for example, today's date might be day 12873461 from a fixed point in history) where I could simply divide by 70 and grab the remainder? Then, use the date function to convert that number into an EST date stamp?

Thanks,
Anthony

--
You received this message because you are subscribed to the Google
Group: "Washington, DC PHP Developers Group" - http://www.dcphp.net
To post, send email to washington-dcphp-group@googlegroups.com
To unsubscribe, send email to washington-dcphp-group+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/washington-dcphp-group?hl=en
---
You received this message because you are subscribed to the Google Groups "Washington, DC PHP Developers Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to washington-dcphp-group+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 comments:

Post a Comment