in reply to Getting the current week number

"Week of the month" is a bit ambiguous. Do you count partial weeks (like June 1 - June 5 of this year)? Do you start on Sunday or Monday? Are you looking for how many 7-day periods were before this date, ignoring Sunday-alignment (probably not since that's trivial)?

If you mean "which column of the calendar does this date go on, if weeks start with Sunday", then this will do:

use POSIX 'ceil'; my $week = 1 + ceil( ($d - $wday - 1) / 7 );
From my basic testing, it seems to work for May (which starts on a Saturday), August (which starts on a Sunday), and June (which starts on a weekday) of this year.

blokhead