in reply to Re^6: Is there an easy way to get the start date of the current week?
in thread Is there an easy way to get the start date of the current week?

ONE_DAY is from Time::Seconds and the object interface to the return value of localtime (instead of accessing array elements by index) is from Time::Piece. Date::Calc was used since its Mktime method accepts date and time fields more obviously than Time::Local's timelocal does, and it had been mentioned in the thread already. It was either that or DateTime which is heavier, but is the Date/Time module I usually use. I guess Time::Local is a fine, if not completely intuitive, choice.
  • Comment on Re^7: Is there an easy way to get the start date of the current week?
  • Download Code