LP#1635737 Add optional context to interval_to_seconds user/dbwells/lp1635737_interval_to_seconds_contextual
authorDan Wells <dbw2@calvin.edu>
Fri, 21 Jul 2017 18:17:34 +0000 (14:17 -0400)
committerDan Wells <dbw2@calvin.edu>
Fri, 21 Jul 2017 18:17:34 +0000 (14:17 -0400)
commit820a4e4ee6416f171b1ba6253503e59b8bc105a9
treebcd70c53d351d608c56ffd7b6918fe2c7e02f666
parenta762c5c832cea9c196594af9a9b3de65d75b69db
LP#1635737 Add optional context to interval_to_seconds

Any given interval (e.g. "1 month") can be a different amount of
seconds depending on the context (i.e. "1 month" after February 1 is
March 1, but "1 month" after March 1 is April 1, yet March is longer
than February).  This affects months all the time, but also can affect
days, hours, and even seconds once you consider DST and "leap" times.

By giving an optional context to interval_to_seconds, you can find the
true number of seconds in, for example, "1 month", when starting from
"February 1" (the context).

Signed-off-by: Dan Wells <dbw2@calvin.edu>
src/perl/lib/OpenSRF/Utils.pm