دالة PHP date_time_set ()
مثال
ضبط الوقت:
<?php
$date=date_create("2013-05-01");
date_time_set($date,13,24);
echo date_format($date,"Y-m-d H:i:s");
?>
التعريف والاستخدام
تعيّن الدالة date_time_set () الوقت.
بناء الجملة
date_time_set(object, hour, minute, second, microseconds)
قيمه المعامل
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
hour | Required. Specifies the hour of the time |
minute | Required. Specifies the minute of the time |
second | Optional. Specifies the second of the time. Default is 0 |
microseconds | Optional. Specifies the microsecond of the time. Default is 0 |
تفاصيل تقنية
قيمة الإرجاع: | إرجاع كائن DateTime عند النجاح. خطأ في الفشل |
---|---|
إصدار PHP: | 5.2+ |
سجل التغيير في PHP: | PHP 7.1: تمت إضافة معامل ميكرو ثانية PHP 5.3: تم تغيير قيمة الإرجاع من NULL إلى DateTime |
❮ PHP مرجع التاريخ / الوقت