I used php timestamp function. its returning values for dates and to calculate number of days between two dates.
but I observed from 8th March its not giving correct answer.
When I run this for each date and see I saw that difference of timestamps for 7th March & 8th march is not 86400. its 82800. Why is that.?
But thereafter its again give correct difference between dates. but its cause for following function to return wrong answer.
Function is to see the Week Number of any given date. Based on a given date weeks are switching every Tuesday.
$base_date = strtotime("2009-02-24"); //which is starting the week# 01
$cal_date = strtotime($input_date);
$diff = $cal_date - $base_date;
$totaldays = (int)floor($diff / (60*60*24));
$w_l1 = (int)floor($totaldays/7);
$w_l2 = $w_l1 % 4;
$week_n = $w_l2+1;