Search here for all the info you want in this Blog

Date functions


Date functions


VBScript supports the following commonly used date and time functions:
q CDate(vVariant) - Converts a valid date and time expression to the variant of subtype Date
q Date() - Returns the current system date
q DateAdd(sType, iInterval, tDate) - Returns a date to which a specified time interval has been added
q DateDiff(tDate1, tDate2) - Returns the number of intervals between two dates
q DatePart(sType, tDate) - Returns the specified part of a given date
q DateSerial(iYear, iMonth, iDate) - Returns the date for a specified year, month, and day
q DateValue(vVariant) - Returns a date
q Day(tDate) - Returns a number that represents the day of the month (between 1 and 31, inclusive)
q FormatDateTime(tDate, iType) - Returns an expression formatted as a date or time
q Hour(tDate) - Returns a number that represents the hour of the day (between 0 and 23, inclusive)
q IsDate(vVariant) - Returns a Boolean value that indicates if the evaluated expression can be converted to a date
q Minute(tDate) - Returns a number that represents the minute of the hour (between 0 and 59, inclusive)
q Month(tDate) - Returns a number that represents the month of the year (between 1 and 12, inclusive)
q MonthName(iMonth) - Returns the name of a specified month
q Now() - Returns the current system date and time
q Second(tDate0 - Returns a number that represents the second of the minute (between 0 and 59, inclusive)
q Time() - Returns the current system time
q Timer() - Returns the number of seconds since 12:00 AM
q TimeSerial(iHour, iMinute, iSecond) - Returns the time for a specific hour, minute, and second
q TimeValue(tDate) Returns a time
q Weekday(tDate) - Returns a number that represents the day of the week (between 1 and 7, inclusive)
q WeekdayName(iWeekDay) - Returns the weekday name of a specified day of the week
q Year(tDate) - Returns a number that represents the year 

No comments:

Post a Comment