TIME

The TIME function returns a time in datetime format.

Syntax

TIME(
    hour,
    minute,
    second
)

Parameters
  • hour: Number representing the hour.
  • minute: Number representing the minute.
  • second: Number representing the second.
Returned value

The TIME function returns a value in datetime format that represents a time.

Additional Information

The arguments can be given by the result of an expression, by a reference to a column or by entering the values directly in the function. The date to which the resulting time is associated is December 30, 1899:

TIME function: Example of use

The following restrictions apply:

hour

If hour takes a value greater than 24, the TIME function will consider the result of calculating hour MOD 24 (that is, 24 will be subtracted as many times as necessary so that hour takes a value between 0 and 23). In the following example hour takes the value 25, and the function considers the value 1 instead:

TIME function: Example of use

If this argument takes a negative value, TIME returns an error.

minute

If minute takes a value greater than 59, the TIME function will convert that number of minutes into hours and minutes. In the following example hour takes the value 0 and minute takes the value 61. TIME converts this amount to an hour and a minute:

TIME function: Example of use

If this argument takes a negative value, TIME returns an error.

second

If second takes a value greater than 59, the TIME function will convert that number of seconds into hours, minutes and seconds. In the following example hour and minute take the value 0 and second takes the value 61. TIME converts this amount to one minute and one second:

TIME function: Example of use

In this other example, hour and minute take the value 0 and second takes the value 3.601. TIME converts this amount to one hour and one second:

TIME function: Example of use

If this argument takes a negative value, TIME returns an error.

Related functions
Category
Date and time
Submitted by admin on Mon, 12/03/2018 - 23:31