Difference between revisions of "Documentation/How Tos/Calc: HOUR function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE: HOUR function}}
 +
{{Documentation/CalcFunc DateTimeTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_WEEKDAY_function
 +
|NextPage=Documentation/How_Tos/Calc:_MINUTE_function
 +
}}__NOTOC__
  
 
== HOUR ==
 
== HOUR ==
 
Returns the hour of a given time.  
 
Returns the hour of a given time.  
 
  
 
=== Syntax: ===
 
=== Syntax: ===
Line 10: Line 14:
  
 
: <tt>'''time'''</tt> may be text or a date-time serial number.
 
: <tt>'''time'''</tt> may be text or a date-time serial number.
 
  
 
=== Example: ===
 
=== Example: ===
<tt>'''HOUR("6 January 2008 21:30:15")'''</tt>
+
<tt>'''HOUR("2008-01-06 21:30:15")'''</tt>
 
: returns <tt>'''21'''</tt>.
 
: returns <tt>'''21'''</tt>.
  
Line 19: Line 22:
 
: where cell A1 contains the time <tt>'''9:25:10'''</tt> as a date-time serial number, returns <tt>'''9'''</tt>.
 
: where cell A1 contains the time <tt>'''9:25:10'''</tt> as a date-time serial number, returns <tt>'''9'''</tt>.
  
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: YEAR function|YEAR]]
 +
* [[Documentation/How_Tos/Calc: MONTH function|MONTH]]
 +
* [[Documentation/How_Tos/Calc: DAY function|DAY]]
 +
* [[Documentation/How_Tos/Calc: WEEKDAY function|WEEKDAY]]
 +
* [[Documentation/How_Tos/Calc: MINUTE function|MINUTE]]
 +
* [[Documentation/How_Tos/Calc: SECOND function|SECOND]]
  
=== See also: ===
+
* [[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]
'''[[Documentation/How_Tos/Calc: YEAR function|YEAR]]''',
 
'''[[Documentation/How_Tos/Calc: MONTH function|MONTH]]''',
 
'''[[Documentation/How_Tos/Calc: DAY function|DAY]]''',
 
'''[[Documentation/How_Tos/Calc: WEEKDAY function|WEEKDAY]]''',
 
'''[[Documentation/How_Tos/Calc: MINUTE function|MINUTE]]''',
 
'''[[Documentation/How_Tos/Calc: SECOND function|SECOND]]'''
 
  
'''[[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]'''
+
* [[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]
  
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Date and Time functions]]

Latest revision as of 13:48, 30 January 2024



HOUR

Returns the hour of a given time.

Syntax:

HOUR(time)

returns the hour of time as a number, 0 - 23.
time may be text or a date-time serial number.

Example:

HOUR("2008-01-06 21:30:15")

returns 21.

HOUR(A1)

where cell A1 contains the time 9:25:10 as a date-time serial number, returns 9.



See Also

Personal tools