Google

Sunday, January 13, 2008

Vb Script Tutorial

10.13 Minute
The Minute function returns a number between 0 and 59 that represents the minute of the hour.
Syntax
Minute(time)

Parameter
Description
time
Required. Any expression that can represent a time
Example 1
document.write(Now & "
")document.write(Minute(Now))Output:1/15/2002 10:34:39 AM34
10.14 Month
The Month function returns a number between 1 and 12 that represents the month of the year.
Syntax
Month(date)

Parameter
Description
date
Required. Any expression that can represent a date
Example 1
document.write(Date & "
")document.write(Month(Date))Output:1/15/20021
10.15 MonthName
The MonthName function returns the name of the specified month.
Syntax
MonthName(month[,abbreviate])

Parameter
Description
month
Required. Specifies the number of the month (January is 1, February is 2, etc.)
abbreviate
Optional. A Boolean value that indicates if the month name is to be abbreviated. Default is False
Example 1
document.write(MonthName(8))Output:August
10.16 Now
The Now function returns the current date and time according to the setting of your computer's system date and time.
Now
Example 1
document.write(Now)Output:1/15/2002 10:52:15 AM

Vb Script Tutorial

10.10 FormatDateTime
The FormatDateTime function formats and returns a valid date or time expression.
Syntax
FormatDateTime(date,format)

Parameter
Description
date
Required. Any valid date expression (like Date() or Now())
format
Optional. A Format value that specifies the date/time format to use
Example 1
document.write("The current date is: ")document.write(FormatDateTime(Date()))Output:The current date is: 2/22/2001
10.11 Hour
The Hour function returns a number between 0 and 23 that represents the hour of the day.
Syntax
Hour(time)

Parameter
Description
time
Required. Any expression that can represent a time
Example 1
document.write(Now & "
")document.write(Hour(Now))Output:1/15/2002 10:07:47 AM10
10.12 IsDate
The IsDate function returns a Boolean value that indicates if the evaluated expression can be converted to a date. It returns True if the expression is a date or can be converted to a date; otherwise, it returns False.
Note: The IsDate function uses local setting to determine if a string can be converted to a date ("January" is not a month in all languages.)
Syntax
IsDate(expression)

Parameter
Description
expression
Required. The expression to be evaluated
Example 1
document.write(IsDate("April 22, 1947") & "
")document.write(IsDate(#11/11/01#) & "
")document.write(IsDate("#11/11/01#") & "
")document.write(IsDate("Hello World!"))Output:TrueTrueFalseFalse