in reply to Re^4: 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?

How about:

sub firstDayOfWeek { my $now = time; my @now = localtime $now; return $now - ( $now[ 6 ] * 2 - 1 ) * 43200; }
  • Comment on Re^5: Is there an easy way to get the start date of the current week?
  • Download Code

Replies are listed 'Best First'.
Re^6: Is there an easy way to get the start date of the current week?
by Tux (Canon) on Aug 22, 2010 at 07:49 UTC

    :)


    Enjoy, Have FUN! H.Merijn
Re^6: Is there an easy way to get the start date of the current week?
by zwon (Abbot) on Aug 22, 2010 at 15:50 UTC

    For some people first day of week is Monday.

      And it's Saturday for others.

      But there is no way to automate for this arbitrary decision. Different companies in the same country, and even different departments within the same company can choose different definitions.