VBScript ฟังก์ชันDateSerial
❮ การอ้างอิง VBScript ที่สมบูรณ์ฟังก์ชัน DateSerial ส่งกลับ Variant of subtype Date สำหรับปี เดือน และวันที่ระบุ
ไวยากรณ์
DateSerial(year,month,day)
Parameter | Description |
---|---|
year | Required. A number between 100 and 9999, or a numeric expression. Values between 0 and 99 are interpreted as the years 19001999. For all other year arguments, use a complete four-digit year |
month | Required. Any numeric expression |
day | Required. Any numeric expression |
ตัวอย่าง
ตัวอย่าง 1
<%
response.write(DateSerial(2010,2,3))
%>
ผลลัพธ์ของโค้ดด้านบนจะเป็น:
2/3/2010
ตัวอย่าง 2
ลบ 10 วัน:
<%
response.write(DateSerial(2010,2,3-10))
%>
ผลลัพธ์ของโค้ดด้านบนจะเป็น:
1/24/2010
❮ การอ้างอิง VBScript ที่สมบูรณ์