PHP | DateTimeImmutable setISODate() Function Last Updated : 11 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The DateTimeImmutable::setISODate() function is an inbuilt function in PHP which is used to sets the ISO (International Organization for Standardization ) date into the created DateTimeImmutable object. This function sets the date according to the ISO 8601 standard, using weeks and day offsets rather than specific dates. Syntax: DateTimeImmutable DateTimeImmutable::setISODate( int year, int week, int day) ) Parameters: This function accepts three parameters as mentioned above and described below: year: This parameter holds the year value in integer format. week: This parameter holds the week value in integer format . day: This parameter holds the day value in integer format .. Return Values: This function returns a new date. Below programs illustrate the DateTimeImmutable::setISODate() function in PHP: Program 1: php <?php // PHP program to illustrate DateTimeImmutable::setISODate() // function // Creating a new DateTimeImmutable() object $datetimeImmutable = new DateTimeImmutable(); // Initialising year, week and day $Year = '2019'; $Week = '10'; $Day = '03'; // Calling the DateTimeImmutable::setISODate() function $a = $datetimeImmutable->setISODate($Year, $Week, $Day); // Getting a new set of date in the // format of 'Y-m-d' echo $a->format('Y-m-d'); ?> Output: 2019-03-06 Program 2: php <?php // PHP program to illustrate DateTimeImmutable::setISODate() // function // Creating a new DateTimeImmutable() object $datetimeImmutable = new DateTimeImmutable(); // Calling the setISODate() function // with parameters like years of 2019, // week of 9 and day of 3 $a = $datetimeImmutable->setISODate(2019, 9, 03); // Getting a new set of date in the // format of 'Y-m-d' echo $a->format('Y-m-d'); ?> Output: 2019-02-27 Reference: https://www.php.net/manual/en/datetimeimmutable.setisodate.php Create Quiz Comment K Kanchan_Ray Follow 0 Improve K Kanchan_Ray Follow 0 Improve Article Tags : Web Technologies PHP PHP-date-time PHP-function Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like