[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

HOUR

Syntax:

HOUR ( time-value )

Description: Computes the hour for the date and/or time having the given time-value.

Arguments:

Name

Type

Description

time-value

number

The date and/or time whose hour is to be computed. That date and/or time shall be expressed either as a serial value, in which case, its integer part is ignored, or as a string-constant having any valid date and/or time format, in which case, any date information shall be ignored.

 

Return Type and Value: number – The hour for the date and/or time having the given time-value. The returned value shall be in the range 0–59.

However, if time-value is out of range for the current date base value, #NUM! is returned.

[Example:

HOUR(DATE(2006,2,26)+TIME(2,10,20)) results in 2
HOUR(TIME(22,56,34)) results in 22
HOUR(0) results in 0, since serial value 0 represents 00:00:00
HOUR(10.5) results in 12, since serial value .5 represents 12:00:00
HOUR("22-Oct-2001 10:53:12") results in 10
HOUR("10:53:12 pm") results in 22
HOUR("22:53:12") results in 22

end example]