in reply to Is there an easy way to get the start date of the current week?
Thanks for your replies! roboticus I had already looked at the DateTime module on CPAN but nothing stood out other than determining the week of the year and then getting the Sunday date from that as being an easy way.
BrowserUk thanks that works fine! Just would be interested if you could breakdown the line
$now -= 43200 while scalar localtime($now) !~ m[Sun];Into what is actually being done here which will help me understand exactly how the answer is acheived.
I did think after I had posted the easy way would be to take date now and just changed the day to Sunday. Could this be what you are doing?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there an easy way to get the start date of the current week?
by james2vegas (Chaplain) on Aug 21, 2010 at 13:33 UTC | |
|
Re^2: Is there an easy way to get the start date of the current week?
by ikegami (Patriarch) on Aug 21, 2010 at 15:48 UTC | |
by JavaFan (Canon) on Aug 21, 2010 at 22:12 UTC | |
by ikegami (Patriarch) on Aug 21, 2010 at 22:55 UTC | |
by BrowserUk (Patriarch) on Aug 22, 2010 at 03:15 UTC |