Join us on Facebook!
28
Feb

Date and Time Formats

by admin 1362 views 0 Comments and 0 Rections

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.

date() = <%= date() %>


now() = <%= now() %>


time() = <%= time() %>


month(date()) = <%= month(date()) %>


day(date()) = <%= day(date()) %>


year(date()) = <%= year(date()) %>


hour(now()) = <%= hour(now()) %>


minute(now()) = <%= minute(now()) %>


second(now()) = <%= second(now()) %>


weekday(now()) = <%= weekday(now()) %>




formatdatetime(now(),vbgeneraldate) = <%= formatdatetime(now(),vbgeneraldate) %>


formatdatetime(now(),vblongdate) = <%= formatdatetime(now(),vblongdate) %>


formatdatetime(now(),vbshortdate) = <%= formatdatetime(now(),vbshortdate) %>


formatdatetime(now(),vblongtime) = <%= formatdatetime(now(),vblongtime) %>


formatdatetime(now(),vbshorttime) = <%= formatdatetime(now(),vbshorttime) %>




year(s) from dates

date_variable = #7/4/1776#

<% date_variable = #7/4/1776# %>
datediff("yyyy",date_variable,date()) =
<%=datediff("yyyy",date_variable,date()) %>


day(s) from dates

date_variable = #7/4/1776#

<% date_variable = #7/4/1776# %>
datediff(date() - date_variable) =
<%= (date() - date_variable) %>



More Posts in "Tutorials"

Comments

blog comments powered by Disqus

Feed Subscription

Get daily inboxed with latest news, reviews and tutorials. Signup now it's free :)



Planetmaks on Twitter

Follow PlanetMaks on Facebook

Recent Comments

Powered by Disqus

Tags

32Bit 64Bit 7 Admin Tool Admin Tools Admin-Tool Admin-Tools AdminTool Adobe Adware All-in-One Anti-Spyware Anti-Virus Apple Backup Tools Browser Browsers Changing Default Directory Codec Data Recovery Download Manager Downloads Drive Utilities Driver Drivers Firefox Flash Freeware Google Graphics Internet Tool Internet-Tool Messaging Microsoft Microsoft Tool Micsellonous Monitoring Multimedia Networking News NVidia Office Tool Office-Tool PC Suite Press Release Registry Samsung Security Shareware Software Softwares Tutorials Vista Windows Windows 7 Windows 8