]> git.evergreen-ils.org Git - OpenSRF.git/commit
LP#1635737 Add optional context to interval_to_seconds
authorDan Wells <dbw2@calvin.edu>
Fri, 21 Jul 2017 18:17:34 +0000 (14:17 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 31 Jul 2017 16:05:13 +0000 (12:05 -0400)
commita481100ef9d5bd9eaad5a87ce29776cb07a8687c
tree7021914cbe1be0e4726c43b8f1e9d0400b9a3cde
parent66acf02b800b6bb9b128c591e7ce480dc111b99d
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>
src/perl/lib/OpenSRF/Utils.pm