पीएचपी एमकेटाइम () फ़ंक्शन
उदाहरण
किसी तिथि के लिए यूनिक्स टाइमस्टैम्प लौटाएं। फिर उस तारीख का दिन खोजने के लिए इसका इस्तेमाल करें:
<?php
// Prints: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a ".date("l", mktime(0,0,0,10,3,1975));
?>
परिभाषा और उपयोग
mktime() फ़ंक्शन किसी दिनांक के लिए यूनिक्स टाइमस्टैम्प लौटाता है।
युक्ति: यह फ़ंक्शन gmmktime() के समान है , सिवाय इसके कि पारित पैरामीटर दिनांक (GMT दिनांक नहीं) का प्रतिनिधित्व करते हैं।
वाक्य - विन्यास
mktime(hour, minute, second, month, day, year, is_dst)
पैरामीटर मान
Parameter | Description |
---|---|
hour | Optional. Specifies the hour |
minute | Optional. Specifies the minute |
second | Optional. Specifies the second |
month | Optional. Specifies the month |
day | Optional. Specifies the day |
year | Optional. Specifies the year |
is_dst | Optional. Set this parameter to 1 if the time is during daylight savings time (DST), 0 if it is not, or -1 (the default) if it is unknown. If it's unknown, PHP tries to find out itself (which may cause unexpected results). Note: This parameter is removed in PHP 7.0. The new timezone handling features should be used instead |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | एक पूर्णांक यूनिक्स टाइमस्टैम्प देता है। त्रुटि पर FALSE |
---|---|
पीएचपी संस्करण: | 4+ |
पीएचपी चेंजलॉग: | PHP 7.1: is_dst
पैरामीटर हटा दिया गया है। PHP 5.3.0: यदि is_dst पैरामीटर का उपयोग किया जाता है तो E_DEPRECATED फेंकता है PHP 5.1: is_dst पैरामीटर को बहिष्कृत किया गया था। यदि mktime() को बिना किसी तर्क के कॉल किया जाता है, तो यह अब E_STRICT नोटिस देता है। इसके बजाय समय() फ़ंक्शन का उपयोग करें। |
❮ पीएचपी दिनांक/समय संदर्भ