in reply to Timestamp of last monday

DateTime. Accept no substitutes.
use DateTime qw(); my $now = DateTime->now; my $previous_monday = $now->subtract(days => ($now->wday_0 || 7)); my $formatted_date = $previous_monday->ymd(q()); # 20111114

Replies are listed 'Best First'.
Re^2: Timestamp of last monday
by Ratazong (Monsignor) on Nov 18, 2011 at 15:00 UTC
    My preferred Swiss Army Knife for date-handling is Date::Calc. It offers Monday_of_Week, which you can use after identifying the week using Week_of_Year.
Re^2: Timestamp of last monday
by vibeweb (Initiate) on Nov 21, 2011 at 13:59 UTC
    Thank you very much! That helped me a lot, but i'm still struggeling with for formatting of the outputtet date, i have read and tried messing with the 'ymd' parameter without any luck
      Scratch that, did'nt look properly on your snippet, sorry. But thanks