Just use the powerful date() function that takes a format string and an optional unix timestamp as arguments. 2: ... 0 − Default. So in the functions below, we find the total numbers of days in full years since the mythical 1/1/0001, then add the number of days before the current one in the year passed. This function returns 0 for Sundays. The Unix timestamp contains the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified. You need to check to see how your client wants to represent the day of week. Getting the week number for a date in PHP is simple. For example: DAYOFWEEK () function MySQL DAYOFWEEK () returns the week day number (1 for Sunday,2 for Monday …… 7 for Saturday) for a date specified as argument. fell on a ' . It allows you to specify whether the week should start on Monday or Sunday and the returned week number should be between 0 and 52 or 0 and 53. the remainder after a division is discarded). Optional. firstdayofweek. $dayOfWeek = date ("l", strtotime ($date)); //Print out the day that our date fell on. To get current month using DateTime class, follow the two steps-Create an object of DateTime() class. Required. Do this for each date, then return the absolute value of the difference. To keep you up-to-date with the ever-growing number of COVID-19 cases in Houston, Texas and the rest of the world, we've come up with a few easy-to-use interactives. Getting Dates From Week Numbers in PHP Recently I've been building a little project that pulls data from Google Analytics and shows your web statistics in a simple form. PHP - Function jddayofweek - This function returns the day of the week. Using DATEPART function: SELECT DATEPART(WEEKDAY, GETDATE()) /* Result */ 4