CodeAve.com CodeAve.com - ASP - Miscellaneous
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Date and Time Formats
There are numerous ways to display date, time and the difference between two dates. The code below shows some of the many ways to display today and the difference between today and July 4, 1776.
View the Output
Text View
Print View
Mail this Link
Download the Code

date() = <%= date() %>
<br>
now() = <%= now() %>
<br>
time() = <%= time() %>
<br>
month(date()) = <%= month(date()) %>
<br>
day(date()) = <%= day(date()) %>
<br>
year(date()) = <%= year(date()) %>
<br>
hour(now()) = <%= hour(now()) %>
<br>
minute(now()) = <%= minute(now()) %> 
<br>
second(now()) = <%= second(now()) %>
<br>
weekday(now()) = <%= weekday(now()) %>
<br>


formatdatetime(now(),vbgeneraldate) = <%= formatdatetime(now(),vbgeneraldate) %>
<br> 
formatdatetime(now(),vblongdate) = <%= formatdatetime(now(),vblongdate) %>
<br>
formatdatetime(now(),vbshortdate) = <%= formatdatetime(now(),vbshortdate) %>
<br>
formatdatetime(now(),vblongtime) = <%= formatdatetime(now(),vblongtime) %>
<br>
formatdatetime(now(),vbshorttime) = <%= formatdatetime(now(),vbshorttime) %>
<br>


year(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff("yyyy",date_variable,date()) = 
<%=datediff("yyyy",date_variable,date()) %>
<br>
day(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff(date() - date_variable) = 
<%= (date() - date_variable) %> 
<br>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3