Date and Time Functions

CDATEReturns the expression converted to a date data type (Date).
CVDATEReturns the expression converted to a variant data type (Variant).
DATE - FunctionReturns the current system date (Date).
DATE - StatementDefines the current system date.
DATEADDReturns the date to which a specified time interval has been added (Date).
DATEDIFFReturns the number of time intervals between two specified dates (Long).
DATEPARTReturns the specified part of a given date (Integer).
DATESERIALReturns the date given a year, month and day (Date).
DATEVALUEReturns the date given a string representation of a date (Date).
DAYReturns the day from a given date (Integer).
FORMATReturns the text string of a number or date in a particular format (String).
FORMATDATETIMEReturns the expression formatted as a date or time (String).
HOURReturns the hour from a given time (Integer).
INTReturns the integer portion of a number (Double).
ISDATEReturns the value indicating if an expression is a date (Boolean).
MINUTEReturns the minute from a given time (Integer).
MONTHReturns the month from a given date (Integer).
MONTHNAMEReturns the month as a string (String).
NOWReturns the current system date and time (Date).
SECONDReturns the second from a given time (Integer).
TIME - FunctionReturns the current system time (Date).
TIME - StatementDefines the current system time.
TIMERReturns the number of seconds elapsed since midnight (Single).
TIMESERIALReturns the time for a specific hour, minute and second (Date).
TIMEVALUEReturns the time given a string representation of a time (Date).
WEEKDAYReturns the number representing the day of the week for a given date (Integer).
WEEKDAYNAMEReturns the day of the week as a string (String).
YEARReturns the year from a date (Integer).
CDATE
Returns the expression converted to a date data type (Date).
CVDATE
Returns the expression converted to a variant data type (Variant).
DATE - Function
Returns the current system date (Date).
DATE - Statement
Defines the current system date.
DATEADD
Returns the date to which a specified time interval has been added (Date).
DATEDIFF
Returns the number of time intervals between two specified dates (Long).
DATEPART
Returns the specified part of a given date (Integer).
DATESERIAL
Returns the date given a year, month and day (Date).
DATEVALUE
Returns the date given a string representation of a date (Date).
DAY
Returns the day from a given date (Integer).
FORMAT
Returns the text string of a number or date in a particular format (String).
FORMATDATETIME
Returns the expression formatted as a date or time (String).
HOUR
Returns the hour from a given time (Integer).
INT
Returns the integer portion of a number (Double).
ISDATE
Returns the value indicating if an expression is a date (Boolean).
MINUTE
Returns the minute from a given time (Integer).
MONTH
Returns the month from a given date (Integer).
MONTHNAME
Returns the month as a string (String).
NOW
Returns the current system date and time (Date).
SECOND
Returns the second from a given time (Integer).
TIME - Function
Returns the current system time (Date).
TIME - Statement
Defines the current system time.
TIMER
Returns the number of seconds elapsed since midnight (Single).
TIMESERIAL
Returns the time for a specific hour, minute and second (Date).
TIMEVALUE
Returns the time given a string representation of a time (Date).
WEEKDAY
Returns the number representing the day of the week for a given date (Integer).
WEEKDAYNAME
Returns the day of the week as a string (String).
YEAR
Returns the year from a date (Integer).

FirstDayOfTheMonth

Excel user defined function - DATEFIRST


LastDayOfTheMonth

Excel user defined function - DATELAST


Pause

This Pause for 5 seconds


IsInThePast

Check if a date is in the past


IsWorkday

This function determines whether a date falls on a weekday. If no date passed in, use today's date.
vbMonday = 2, vbSaturday = 7, vbSunday = 1


IsLeapYear


WhichQuarter


Time Loop


Anniversary

The following procedure finds the anniversary of a given date; that is, the next date on which it occurs.
If the anniversary has already occurred this year, the procedure returns the date of the anniversary in the next year.
This function finds the next anniversary of a date. If the date has already passed for this year, it returns the date on which the anniversary occurs in the following year.
The procedure determines the last day of the last year by using the DateSerial function, and then subtracts that date from the date that was passed in to the procedure.


DayOfTheYear

This function takes a date as an argument and returns the day number for that year.
If the dteDate argument is omitted, the function uses the current date.
Using the DateDiff function to determine the number of years between today and a birthdate doesn't always give a valid result because the DateDiff function rounds to the next year.
If a person's birthday hasn't yet occurred, using the DateDiff function will make the person one year older than he or she actually is.
To remedy this situation, the procedure checks to see whether the birthday has already occurred this year, and if it hasn't, it subtracts 1 to return the correct age.


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext