INMHO: create a package rapper around and export API return answers to which questions you have. Using Data::Calc be a good practice.
Regards Chanan On Sun, Dec 30, 2012 at 9:40 AM, Oren Izmirli <[email protected]> wrote: > On 30/12/2012 09:09, Yona Shlomo wrote: > > Hello, > > I have date items of the form yyyy-mm-dd and I'd like to be > able to manipulate them in the following ways: > > Given such a date I'd like to ask ordinal questions such as: > what was the date k days before (e.g., what is the date > yesterday) or what will be the date n days from that date > (e.g., what's the date 10 days later). > > What's a practical way to go about this? > > > I like to use Date::Calc for things like this. > https://metacpan.org/module/STBEY/Date-Calc-6.3/lib/Date/Calc.pod > > This may be the function your looking for: > ($year, $month, $day) = Add_Delta_Days($year, $month, $day, $Dd); > IINM, $Dd can be negative. > > > _______________________________________________ > Perl mailing list > [email protected] > http://mail.perl.org.il/mailman/listinfo/perl -- =================== ---- Chanan Berler ---- =================== _______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
