PHP mktime() လုပ်ဆောင်ချက်
ဥပမာ
ရက်စွဲတစ်ခုအတွက် Unix အချိန်တံဆိပ်ကို ပြန်ပေးပါ။ ထို့နောက် ထိုရက်စွဲ၏နေ့ရက်ကို ရှာဖွေရန် ၎င်းကို အသုံးပြုပါ။
<?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() လုပ်ဆောင်ချက်သည် ရက်စွဲတစ်ခုအတွက် Unix အချိန်တံဆိပ်ကို ပြန်ပေးသည်။
အကြံပြုချက်- ဤလုပ်ဆောင်ချက်သည် 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 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ကိန်းပြည့် Unix အချိန်တံဆိပ်ကို ပြန်ပေးသည်။ အမှားတွင် မှားနေသည်။ |
---|---|
PHP ဗားရှင်း- | 4+ |
PHP Changelog- | PHP 7.1- is_dst ဘောင်
ကို ဖယ်ရှားလိုက်ပါပြီ။ PHP 5.3.0- is_dst ပါရာမီတာကို PHP 5.1 ကိုအသုံးပြုပါ က is_dst ကန့်သတ်ဘောင်ကို ရပ်ဆိုင်းထား သည်။ အကြောင်းပြချက်မရှိဘဲ mktime() ကိုခေါ်ဆိုပါက၊ ၎င်းသည် ယခုအခါ E_STRICT သတိပေးချက်ကို လွှင့်တင်မည်ဖြစ်သည်။ ၎င်းအစား time() လုပ်ဆောင်ချက်ကို အသုံးပြုပါ။ |
❮ PHP နေ့စွဲ/အချိန် အကိုးအကား