![]() |
|
|
Displaying and formatting Dates and TimesJust to clear up an issue, the date and time displayed on this page are provided by my server so may not be the same where you are. Some of the dates are displayed in UK format ie dd/mm/yyyy rather than the American mm/dd/yyyy, though they'll display correctly according to where your server is located. <% strNow=Now()' this variable
will be used later below %>
strNow holds the value 07/09/2008 06:56:40 <%= Date() %> prints out 07/09/2008 <%= Now() %> prints out 07/09/2008 06:56:40 <%= Time() %> prints out 06:56:40 <%= FormatDateTime(strNow, vbGeneralDate)
%> prints out 07/09/2008 <%= FormatDateTime(strNow, vbLongDate)
%> prints out 07 September 2008 <%= FormatDateTime(strNow,vbShortDate)
%> prints out 07/09/2008 <%= FormatDateTime(strNow, vbLongTime)
%> prints out 06:56:40 <%= FormatDateTime(strNow, vbShortTime)
%> prints out 06:56 <%= Year(strNow) %> prints out
2008 <%= Month(strNow) %> prints out
9 <%=Day(strNow) %> prints out
7 <%=Hour(strNow) %> prints out
6 <%=Minute(strNow) %> prints out
56 <%=Second(strNow) %> prints out
40 <%= WeekDay(strNow) %> prints
out 1 <%= WeekDayName(WeekDay(strNow)) %>
prints out Sunday <%= WeekDayName(WeekDay(strNow), 1) %>
prints out Sun Other date and time related tutorials:
Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|