title: How to write current date in ASP Code?
body: <p>May i know how to write a ASP code to show current date ? For the example, if user key in today date, the system will allow, while if the user key in previous date it will block and show error message. thank you.</p>
  
  <p>As below is the ASP code </p>
  
  <pre><code>DIM PINVDATE,PTQTY
  
  PINVDATE = Request.Form("PINVDATE")
  PTQTY = Request.Form("PTQTY")
  
  If TRIM(PINVDATE) = "" and TRIM(PTQTY) = "" Then
  
  Msg = "** Mandatory Field not filled, please check !!!"
  
  Response.Redirect "plan.asp?empid="&amp; EmpID &amp; "&amp;Name=" &amp; EmpName &amp; "&amp;EmpLevel=" &amp; EmpLevel &amp; "&amp;ref=" &amp; Msg
  
  else
  
  If TRIM(PINVDATE) = "" THEN
  
  Msg = "** Date not filled, Please Check !!!"
  
  Response.Redirect "plan.asp?empid="&amp; EmpID &amp; "&amp;Name=" &amp; EmpName &amp; "&amp;EmpLevel=" &amp; EmpLevel &amp; "&amp;ref=" &amp; Msg
  
  else
  
  if TRIM(PTQTY) = "" then
  
  Msg = "** Quantity not filled, Please Check !!!"
  
  Response.Redirect "plan.asp?empid="&amp; EmpID &amp; "&amp;Name=" &amp; EmpName &amp; "&amp;EmpLevel=" &amp; EmpLevel &amp; "&amp;ref=" &amp; Msg
  
  END IF
  END IF
  END IF
  
  &lt;tr&gt;
  &lt;th bgcolor="#8585A6" &gt;&lt;font color="white"&gt;Date&lt;/font&gt;&lt;/th&gt;
  &lt;th colspan = 3 bgcolor="#ECE5B6" align=left&gt;&lt;input type ="text" name="PINVDATE" style="text-align: left" size = 23 maxlength="30"/&gt;&lt;font color='Red'&gt;** Exp: YYYY-MM-DD&lt;/font&gt;&lt;/th&gt;
  &lt;/tr&gt;
  </code></pre>