MS-Excel / General Formatting

VBA Date and Time Functions

FunctionWhat It Returns
DateThe current system date as a Variant.
Date$()The current system date as a String.
DateAdd(interval, number, date)A Date value derived by adding number time intervals (months, quarters, and so on) to date.
DateDiff(interval, date1, date2,...)The number of time intervals between date1 and date2.
DatePart(interval, date,...)The interval given by date.
DateSerial(year, month, day)A Date value for the specified year, month, and day.
DateValue(date)A Date value for the date string.
Day(date)The day of the month given by date.
Hour(time)The hour component of time.
Minute(time)The minute component of time.
Month(date)The month component of date.
MonthName(month,abbreviate)The name of the month associated with the specified month number.
NowThe current system date and time.
Second(time)The second component of time.
TimeThe current system time as a Variant.
Time$The current system time as a String.
TimerThe number of seconds since midnight.
TimeSerial(hour, minute, second)A Date value for the specified hour, minute, and second.
TimeValue(time)A Date value for the time string.
Weekday(date)The day of the week, as a number, given by date.
WeekdayName(weekday,abbreviate)The name of the weekday associated with the specified weekday number.
Year(date)The year component of date.
[Previous] [Contents] [Next]