PHP date_isodate_set() လုပ်ဆောင်ချက်
ဥပမာ
ISO ရက်စွဲကို 2013 တွင် 5 ရက်သတ္တပတ်သို့ သတ်မှတ်ပါ-
<?php
$date=date_create();
date_isodate_set($date,2013,5);
echo date_format($date,"Y-m-d");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
date_isodate_set() လုပ်ဆောင်ချက်သည် ရက်သတ္တပတ်များနှင့် နေ့စွဲများ (တိကျသောရက်စွဲကို အသုံးပြုမည့်အစား) ကိုအသုံးပြု၍ ISO 8601 စံနှုန်းအတိုင်း ရက်စွဲတစ်ခု သတ်မှတ်သည်။
အထားအသို
date_isodate_set(object, year, week, day)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
year | Required. Specifies the year of the date |
week | Required. Specifies the week of the date |
day | Optional. Specifies the offset from the first day of the week. Default is 1 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုတွင် DateTime အရာဝတ္ထုကို ပြန်ပေးသည်။ ရှုံးနိမ့်မှုအပေါ် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | 5.2+ |
PHP Changelog- | PHP 5.3- ပြန်တန်ဖိုးကို NULL မှ DateTime သို့ ပြောင်းလဲခဲ့သည်။ |
❮ PHP နေ့စွဲ/အချိန် အကိုးအကား