Syntax

TIME(when)

Arguments

  • when (Date, DateTime, or Time)

Because temporal types are Text values with specific formats, any textual value may be supplied to TIME(), but non-temporal values will produce a blank result.

Return Value

Time: The converted value if when is recognized as a Date, DateTime, or Time value, or blank if not. If when is a Date value, which has no time component, 12:00:00 AM is returned.

Examples

TIME("3:14") (24-hour time if no AM/PM): 3:14:00 AM

TIME("15:14") (24-hour time): 3:14:00 PM

TIME("3:14 PM") (12-hour time with AM/PM): 3:14:00 PM

TIME(TIMENOW()) : The current time from a Time value. See also TIMENOW().

TIME("4/1/2010") : 12:00:00 AM (a Date value has no time component, so a default is used).

TIME(TODAY()) : 12:00:00 AM (TODAY() returns a Date value, which has no time component, so a default is used).

TIME("4/1/2010 3:14") : 3:14:00 AM

TIME(NOW()) : The current time from a DateTime value. See also NOW().

Potential Problems

TIME("Good morning, Martin!") : Returns blank because the textual input isn't a recognized temporal type and so cannot be converted.

See Also

DATE(), DATETIME()

Did this answer your question?