YouTip LogoYouTip

Vbscript Ref Functions

*

This page lists all built-in VBScript functions, mainly divided into the following categories:

Date/Time Functions

Function Description
CDate Converts a valid date and time expression to Date type.
Date Returns the current system date.
DateAdd Returns a date with a specified time interval added.
DateDiff Returns the number of time intervals between two dates.
DatePart Returns the specified part of a given date.
DateSerial Returns a date for the specified year, month, and day.
DateValue Returns a date.
Day Returns a number representing the day of the month (between and including 1 to 31).
FormatDateTime Returns an expression formatted as a date or time.
Hour Returns a number representing the hour of the day (between and including 0 to 23).
IsDate Returns a Boolean value indicating whether an expression can be converted to a date.
Minute Returns a number representing the minute of the hour (between and including 0 to 59).
Month Returns a number representing the month of the year (between and including 1 to 12).
MonthName Returns the name of the specified month.
Now Returns the current system date and time.
Second Returns a number representing the second of the minute (between and including 0 to 59).
Time Returns the current system time.
Timer Returns the number of seconds since 12:00 AM.
TimeSerial Returns a time for the specific hour, minute, and second.
TimeValue Returns a time.
Weekday Returns a number representing the day of the week (between and including 1 to 7).
WeekdayName Returns the weekday name for a specified day in the week.
Year Returns a number representing the year.
Function Description
Asc Converts the first letter in a string to an ANSI character code.
CBool Converts an expression to Boolean type.
CByte Converts an expression to Byte type.
CCur Converts an expression to Currency type.
CDate Converts a valid date and time expression to Date type.
CDbl Converts an expression to Double type.
Chr Converts a specified ANSI character code to a character.
CInt Converts an expression to Integer type.
CLng Converts an expression to Long type.
CSng Converts an expression to Single type.
CStr Converts an expression to String type.
Hex Returns the hexadecimal value of a specified number.
Oct Returns the octal value of a specified number.
Function Description
FormatCurrency Returns an expression formatted as a currency value.
FormatDateTime Returns an expression formatted as a date or time.
FormatNumber Returns an expression formatted as a number.
FormatPercent Returns an expression formatted as a percentage.
Function Description
Abs Returns the absolute value of a specified number.
Atn Returns the arctangent of a specified number.
Cos Returns the cosine of a specified number (angle).
Exp Returns e raised to a power.
Hex Returns the hexadecimal value of a specified number.
Int Returns the integer part of a specified number.
Fix Returns the integer part of a specified number.
Log Returns the natural logarithm of a specified number.
Oct Returns the octal value of a specified number.
Rnd Returns a random number that is less than 1 but greater than or equal to 0.
Sgn Returns an integer that indicates the sign of a specified number.
Sin Returns the sine of a specified number (angle).
Sqr Returns the square root of a specified number.
Tan Returns the tangent of a specified number (angle).
Function Description
Array Returns a variable containing an array.
Filter Returns a zero-based array that contains a subset of a string array based on specific filtering criteria.
IsArray Returns a Boolean value indicating whether a specified variable is an array.
Join Returns a string made up of several substrings from an array.
LBound Returns the smallest subscript indicating the dimension of an array.
Split Returns a one-dimensional zero-based array containing a specified number of substrings.
UBound Returns the largest subscript indicating the dimension of an array.
← Vbscript Ref KeywordsVbscript Examples β†’