VBA date and time functions (13)

VBScript date and time functions help developers date and time from one format to another format, or date or time values ​​represents a format suitable for specific conditions.

Date Functions

Numbering function description
1 Date A function that returns the current system date.
2 CDate A function that, given input into a date.
3 DateAdd A function that returns a date specified time interval is added.
4 DateDiff A function that returns the difference between two time periods.
5 DatePart A function that returns a portion of the specified date given input value.
6 DateSerial Function that returns the effective date of the given year, month and day.
7 FormatDateTime A function, according to the parameters provided by the date format.
8 IsDate No matter whether the parameters provided to date, the function returns a Boolean value.
9 Day A function that returns a 1to 31integer, indicates the specified date one day.
10 Month A function that returns a number between 1and 12integer representing the month of the specific date.
11 Year A function that returns an integer that represents the year of the specified date.
12 MonthName A function that returns the name of the specified date of a given month.
13 WeekDay A function that returns an integer ( 1to 7), represents the day of the week specified date.
14 WeekDayName A function that returns a few weeks of the date specified name.

Time Functions

Numbering function description
1 Now A function that returns the current system date and time.
2 Hour A function that returns a value from 0the 23integer representing a portion of a given hour of time.
3 Minute A function that returns 0the 59integer representing a minute portion of a given time.
4 Second A function that returns 0to 59an integer representing the number of seconds in a given time portion.
5 Time A function that returns the current system time.
6 Timer A function that returns from the morning 12:00since the number of seconds and milliseconds.
7 TimeSerial A function that returns hours, minutes and time specific inputs seconds.
8 TimeValue The input string is converted to a function of time format.

Guess you like

Origin www.cnblogs.com/sunyllove/p/11348273.html