In this article we will explain how to calculate the number of days between two dates in PHP. Aug 19, 2008 #1 I want to calculate week number for a month based on a date and the weekday will start from Friday. m – Represents month in numbers with leading zeros (01 or 12). Need to get the last date of this month? You could even use this to figure out what day of the week it falls on, or how many days are in this month: PHP 1. Read this tutorial to set timezone in PHP configuration. Next: Write a JavaScript function to get the month name from a particular date. Date.AddYears: Returns a DateTime value with the year portion incremented by n years. All gists Back to GitHub Sign in Sign up Sign in Sign up {{ message }} Instantly share code, notes, and snippets. This can produce different, and seemingly incorrect, results depending on your PHP version and your choice of 'w' or 'N' for the Numeric representation of the day of the week: