PHP date_isodate_set()Functions
PHP Date/Time Reference Manual
Examples
Set the ISO date of week 5 in 2013:
<?php
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
Run example »
Definition and Usage
The date_isodate_set() function sets the date according to the ISO 8601 standard, using week and day offsets (instead of using a specified date).
Syntax
date_isodate_set(object,year,week,day);
| Parameter | Description |
|---|---|
| object | Required. Specifies adate_create()DateTime object returned. |
| year | Required. Specifies the year in the date. |
| week | Required. Specifies the week in the date. |
| day | Optional. Specifies the offset from the first day of the week. Default is 1. |
Technical Details
| Return value: | Returns a DateTime object on success, or FALSE on failure. |
|---|---|
| PHP Version: | 5.2+ |
| Changelog: | PHP 5.3.0: The return value was changed from NULL to DateTime. |
PHP Date/Time Reference Manual Other extensions