VBA Functions: Dates and Times

Find the list of all the main VBA functions on the VBA Functions page.

Dates and Times

CDateConverts a value to a date.
DateReturns the current date.
DateAddAdds the specified time interval to a date.
DateDiffReturns an integer corresponding to the number of specified time intervals between 2 dates.
DatePartReturns an integer corresponding to a data of a date.
DateSerialReturns a date based on a year, a month, and a day.
DateValueConverts a string to a date.
DayReturns an integer corresponding to the day of a date.
FormatReturns a string according to a date or number in the specified format.
HourReturns an integer corresponding to the hour of a date or time.
IsDateReturns True if the value is a date (or can be converted into a date) or False if it is not.
MinuteReturns an integer corresponding to the minutes of a date or time.
MonthReturns an integer corresponding to the month of a date.
MonthNameReturns the name of the month based on the month number.
NowReturns the current date and time.
SecondReturns an integer corresponding to the seconds of a date or time.
TimeReturns the current system time.
TimerReturns the number of seconds elapsed since midnight.
TimeSerialReturns a time based on an hour, minutes, and seconds.
TimeValueConverts a string into time.
WeekdayReturns the number of the day of the week based on a date.
WeekdayNameReturns the name of the day based on the number of the day of the week.
YearReturns an integer corresponding to the year of a date.