VBA Functions: Dates and Times
Find the list of all the main VBA functions on the VBA Functions page.
Dates and Times
| CDate | Converts a value to a date. |
| Date | Returns the current date. |
| DateAdd | Adds the specified time interval to a date. |
| DateDiff | Returns an integer corresponding to the number of specified time intervals between 2 dates. |
| DatePart | Returns an integer corresponding to a data of a date. |
| DateSerial | Returns a date based on a year, a month, and a day. |
| DateValue | Converts a string to a date. |
| Day | Returns an integer corresponding to the day of a date. |
| Format | Returns a string according to a date or number in the specified format. |
| Hour | Returns an integer corresponding to the hour of a date or time. |
| IsDate | Returns True if the value is a date (or can be converted into a date) or False if it is not. |
| Minute | Returns an integer corresponding to the minutes of a date or time. |
| Month | Returns an integer corresponding to the month of a date. |
| MonthName | Returns the name of the month based on the month number. |
| Now | Returns the current date and time. |
| Second | Returns an integer corresponding to the seconds of a date or time. |
| Time | Returns the current system time. |
| Timer | Returns the number of seconds elapsed since midnight. |
| TimeSerial | Returns a time based on an hour, minutes, and seconds. |
| TimeValue | Converts a string into time. |
| Weekday | Returns the number of the day of the week based on a date. |
| WeekdayName | Returns the name of the day based on the number of the day of the week. |
| Year | Returns an integer corresponding to the year of a date. |