VBScript DatePart လုပ်ဆောင်ချက်
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။DatePart လုပ်ဆောင်ချက်သည် ပေးထားသော ရက်စွဲတစ်ခု၏ သတ်မှတ်ထားသော အပိုင်းကို ပြန်ပေးသည်။
အထားအသို
DatePart(interval,date[,firstdayofweek[,firstweekofyear]])
Parameter | Description |
---|---|
interval | Required. The interval of time to return. Can take the following values:
|
date | Required. Date expression to evaluate |
firstdayofweek | Optional. Specifies the day of the week. Can take the following values:
|
firstweekofyear | Optional. Specifies the first week of the year. Can take the following values:
|
ဥပမာများ
ဥပမာ ၁
ရက်စွဲတစ်ခုမှ လကို ရယူပါ-
<%
d=CDate("2010-02-16")
response.write(DatePart("m",d))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
2
ဥပမာ ၂
ကျွန်ုပ်တို့၏လကိုရယူပါ-
<%
response.write(DatePart("m",Now()))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
1
ဥပမာ ၃
နာရီကို ရယူပါ
<%
response.write(DatePart("h",Now())
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
13
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။