VBScript Hàm DateSerial
❮ Tham khảo VBScript hoàn chỉnhHàm DateSerial trả về một Biến thể của kiểu con Ngày cho một năm, tháng và ngày được chỉ định.
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 1900�1999. For all other year arguments, use a complete four-digit year |
month | Required. Any numeric expression |
day | Required. Any numeric expression |
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
Hiển thị ví dụ »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
Hiển thị ví dụ »❮ Tham khảo VBScript hoàn chỉnh