How I can get the pre and post dates of the week
Hello guys I'm building with my calendar.
I'm trying to get the pre and post day of the current month for my
calendar. Actually the calendar is already working but its not the same
with the time with my laptop.
Do I have to change something in this code?
// calculate the number of days in the current month
$day_count = cal_days_in_month(CAL_GREGORIAN, $month, $year);
// get number of days for the next month
$pre_days = (6 - (date('w', mktime(0, 0, 0, $month, $day_count, $year))));
// get number of days after the month
$post_days = date('w', mktime(0, 0, 0, $month, 1, $year));
Then I'm making a loop to display the dates..
No comments:
Post a Comment