VBScript Fungsi DateSerial
Referensi VBScript LengkapFungsi DateSerial mengembalikan Varian dari subtipe Tanggal untuk tahun, bulan, dan hari tertentu.
Sintaksis
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 |
Contoh
Contoh 1
<%
response.write(DateSerial(2010,2,3))
%>
Output dari kode di atas akan menjadi:
2/3/2010
Contoh 2
Kurangi 10 hari:
<%
response.write(DateSerial(2010,2,3-10))
%>
Output dari kode di atas akan menjadi:
1/24/2010
Referensi VBScript Lengkap