دالة PHP date_isodate_set ()
مثال
اضبط تاريخ ISO على الأسبوع الخامس في عام 2013:
<?php
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
التعريف والاستخدام
تحدد الوظيفة date_isodate_set () تاريخًا وفقًا لمعيار ISO 8601 ، باستخدام تعديلات الأسابيع والأيام (بدلاً من استخدام تاريخ محدد).
بناء الجملة
date_isodate_set(object, year, week, day)
قيمه المعامل
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 |
تفاصيل تقنية
قيمة الإرجاع: | إرجاع كائن DateTime عند النجاح. خطأ في الفشل |
---|---|
إصدار PHP: | 5.2+ |
سجل التغيير في PHP: | PHP 5.3: تم تغيير قيمة الإرجاع من NULL إلى DateTime |
❮ PHP مرجع التاريخ / الوقت