PHP date_isodate_set() Function

PHP date_isodate_set Function


Definition:

In php date_isodate_set() Function is inbuilt function.PHP date_isodate_set() function is used to set the date according to the ISO 8601 standard using weeks and day offsets instead of using the given specific date and month.

Syntax

     date_isodate_set(object, year, week, day)

Parameter
Parameter Description
object Required. Specifies a DateTime object returned by date_create()
year Required. Specifies the year of the date
week Required. Specifies the week of the date
day Optional. Specifies the offset from the first day of the week. Default is 1

Given below example Set the ISO date to the 5th week in 2015

Output : 2015-01-26
              2015-01-27