LP#1635737 Add optional context to interval_to_seconds
authorDan Wells <dbw2@calvin.edu>
Tue, 6 Nov 2018 20:13:47 +0000 (15:13 -0500)
committerDan Wells <dbw2@calvin.edu>
Tue, 6 Nov 2018 20:13:47 +0000 (15:13 -0500)
commit57237ae64710f32a9d99111465cfe537050a836c
tree1bd3dc3225cbb2e2e5db0b79bad373e5b4c7ec69
parent8f74b164c8ba012375fec51950c10963626cf6fc
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>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/DateTime.pm