<%
Dim myArray()
For i = 1 to 7
Redim Preserve myArray(i)
myArray(i) = WeekdayName(i)
Next
%>
结果:建立了一个包含7个元素的数组myArray
myArray("Sunday","Monday", ... ... "Saturday")
<%
fromDate = #8/4/99#
toDate = #1/1/2000#
response.write("There are " & _
DateDiff("d",fromDate,toDate) & _
" days to millenium from 8/4/99."
%>
结果: There are150daysto millenium from 8/4/99.
Day()
作用: 返回一个月的第几日 .
语法: Day(date)
说明: date 是任何有效的日期。
<%
strTest = "This is a test! Today is Monday."
response.write Mid(strTest, 17, 5)
%>
结果: Today
Minute()
作用: 返回时间的分钏.
语法: Minute(time)
说明:
<%=Minute(#12:45:32 PM#)%>结果: 45
Month()
作用: 返回日期.
语法: Month(date)
说明: date is any valid date expression.
<%=Month(#08/04/99#)%>结果: 8
MonthName()
作用: Returns a string identifying the specified month.
语法: MonthName(month, [, Abb >)
说明: month is the numeric representation for a given month; Abb (optional) is a boolean value used to display month abbreviation. True will display the abbreviated month name and False (default) will not show the abbreviation.
<%=MonthName(Month(#08/04/99#))%>结果: August
Now()
作用: Returns the current system date and time.返回当前系统时间
语法: Now()
说明: None
<%=Now%>结果: 8/4/99 9:30:16 AM
Replace()
作用: Returns a string in which a specified sub-string has been replaced with another substring a specified number of times.
语法: Replace(strToBeSearched, strSearchFor, strReplaceWith [, start [, count [, compare >>>)
说明: strToBeSearched is a string expression containing a sub-string to be replaced; strSearchFor is the string expression to search for within strToBeSearched; strReplaceWith is the string expression to replace sub-string strSearchFor; start (optional) is the numeric character position to begin search; count (optional) is a value indicating the comparision constant.
<%
strTest = "This is an apple!"
response.write Replace(strTest, "apple", "orange")
%>