ppapro has asked for the wisdom of the Perl Monks concerning the following question:
Hi All,
I am trying to implement the logic that will return the date of nearest saturday (similar to oracle next_day function)... here is what I have so far:
The code above is giving correct results for most of the week hoever it looks wrong when run on saturday and sunday. Then instead of nearest(read next) saturday it returns current day...perl -MDate::Calc=:all -e 'printf "%04s%02s%02s", Add_Delta_Days(Monda +y_of_Week(Week_of_Year(Today())), 5);'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How for the current date return nearest saturday
by toolic (Bishop) on May 25, 2011 at 17:06 UTC | |
|
Re: How for the current date return nearest saturday
by wind (Priest) on May 25, 2011 at 19:35 UTC | |
|
Re: How for the current date return nearest saturday
by zek152 (Pilgrim) on May 25, 2011 at 17:19 UTC | |
by ppapro (Initiate) on May 25, 2011 at 17:36 UTC | |
|
Re: How for the current date return nearest saturday
by Anonymous Monk on May 25, 2011 at 17:14 UTC | |
|
Re: How for the current date return nearest saturday
by ww (Archbishop) on May 26, 2011 at 01:48 UTC |