पीएचपी 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 |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर डेटटाइम ऑब्जेक्ट देता है। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 5.2+ |
पीएचपी चेंजलॉग: | PHP 7.1: जोड़ा गया माइक्रोसेकंड पैरामीटर PHP 5.3: वापसी मान को NULL से DateTime में बदला गया |
❮ पीएचपी दिनांक/समय संदर्भ