Time Functions

Time functions perform specific operations regarding time information. These functions enter or calculate a time. The time functions are summarized in the table below.

Function

Result

DiffHours

Calculates and returns the absolute time difference in hours between two times.

DiffMinutes

Calculates and returns the absolute time difference in minutes between two times.

DiffSeconds

Calculates and returns the absolute time difference in seconds between two times.

DiffTime

Calculates the difference in time between two times and returns a signed (positive or negative) value, given in seconds.

Hour

Extracts and returns the number of hours from a time.

Minute

Extracts and returns the number of minutes from a time.

Second

Extracts and returns the number of seconds from a time.

Time

Returns a time string or the current time in a specified format.

Time2Time

Converts a time from one format to another and returns the result.

TimeAdd

Adds time to a time and returns the new time.

TimeZone

Returns the system’s time zone setting or makes sure a time zone is valid.

TimeZone2TimeZone

Converts date and time values from one geographic region into date and time values that are local to another geographic region.

Before examining each individual time function, take a look at the time formats. Time formats are usually one of the parameters you enter for a time function. The time format determines how your time information appears when it is returned to the section.

See Also