Get Last four week (start and end date)

get current date

$custom_date = strtotime( date('Y-m-d') );

Last week date on Monday and Sunday.

$week_start1 = date('Ymd', strtotime('last week last monday', $custom_date));
$week_end1 = date('Ymd', strtotime('last week next sunday', $custom_date));

Second Last week date on Monday and Sunday.

$week_start2 = date('Ymd', strtotime('last week last monday -7 days', $custom_date));
$week_end2 = date('Ymd', strtotime('last week next sunday -7 days', $custom_date));

Third Last week date on Monday and Sunday.

$week_start3 = date('Ymd', strtotime('last week last monday -14 days', $custom_date));
$week_end3 = date('Ymd', strtotime('last week next sunday -14 days', $custom_date));

Fourth Last week date on Monday and Sunday.

$week_start4 = date('Ymd', strtotime('last week last monday -21 days', $custom_date));
$week_end4 = date('Ymd', strtotime('last week next sunday -21 days', $custom_date));

Advertisements

3 thoughts on “Get Last four week (start and end date)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s