PHP date_interval_format() လုပ်ဆောင်ချက်
ဥပမာ
ရက်စွဲနှစ်ခုကြားရှိ ကြားကာလကို တွက်ချက်ပြီး ကြားကာလကို ဖော်မတ်ပါ။
<?php
$date1=date_create("2013-01-01");
$date2=date_create("2013-02-10");
$diff=date_diff($date1,$date2);
// %a outputs the total number of days
echo $diff->format("Total number of days: %a.");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
date_interval_format() လုပ်ဆောင်ချက်သည် DateInterval::format() ၏ နံပတ်တစ်ခုဖြစ်သည်။
DateInterval::format() လုပ်ဆောင်ချက်ကို ကြားကာလကို ဖော်မတ်ရန် အသုံးပြုသည်။
အထားအသို
DateInterval::format(format)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
format | Required. Specifies the format. The following characters can be used in the format parameter string:
Note: Each format character must be prefixed by a % sign! |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဖော်မတ်လုပ်ထားသည့် ကြားကာလကို ပြန်ပေးသည်။ |
---|---|
PHP ဗားရှင်း- | 5.3+ |
PHP Changelog- | PHP 7.1- F နှင့် f ဘောင်များကို ထည့်ထားသည်။ |
❮ PHP နေ့စွဲ/အချိန် အကိုးအကား