PHP date_date_set() လုပ်ဆောင်ချက်
ဥပမာ
DateTime အရာဝတ္ထုအသစ်ကို ပြန်ပေးကာ ရက်စွဲအသစ်တစ်ခု သတ်မှတ်ပြီးနောက် ရက်စွဲကို ဖော်မတ်လုပ်ပါ-
<?php
$date=date_create();
date_date_set($date,2020,10,30);
echo date_format($date,"Y/m/d");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
date_date_set() လုပ်ဆောင်ချက်သည် ရက်စွဲအသစ်ကို သတ်မှတ်ပေးသည်။
အထားအသို
date_date_set(object, year, month, day)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
year | Required. Specifies the year of the date |
month | Required. Specifies the month of the date |
day | Required. Specifies the day of the date |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုတွင် DateTime အရာဝတ္ထုအသစ်ကို ပြန်ပေးသည်။ ရှုံးနိမ့်မှုအပေါ် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | 5.2+ |
PHP Changelog- | PHP 5.3- ပြန်လာတန်ဖိုးကို NULL မှ DateTime သို့ ပြောင်းခဲ့သည် (အောင်မြင်သည်) |
❮ PHP နေ့စွဲ/အချိန် အကိုးအကား