VBScript Hàm DateSerial
❮ Toàn bộ tài liệu tham khảo VBScriptHàm DateSerial trả về một biến thể của kiểu phụ Ngày cho một năm, tháng và ngày cụ thể.
Cú pháp
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 |
Các ví dụ
ví dụ 1
<%
response.write(DateSerial(2010,2,3))
%>
Đầu ra của đoạn mã trên sẽ là:
2/3/2010
Ví dụ 2
Trừ 10 ngày:
<%
response.write(DateSerial(2010,2,3-10))
%>
Đầu ra của đoạn mã trên sẽ là:
1/24/2010
❮ Toàn bộ tài liệu tham khảo VBScript