Dim v1
v1=5.43
Response.Write "Type of " & TypeName(v1)
Response.Write "<br>"
Response.Write CInt(v1) ' Output will be 5
If the last line is changed by using Cdbl then output will be like this
Response.Write CDbl(v1) ' Output will be 5.43
CDate() converts an expression to a Date value. String-to-date conversion depends on the server locale, so avoid ambiguous numeric date strings when possible.
Dim eventDate
eventDate = CDate("September 22, 2026")
Response.Write eventDate
When you already have numeric year, month, and day components, DateSerial() is usually clearer.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.