Hour: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''
Hour(''time'')
Hour(''time'')


Line 5: Line 7:
Hour returns a whole number ranging from 0 to 23 that represents the hour of day of a given time. The required parameter, ''time'', can be any numeric or string expression, or any expression that represents a time.
Hour returns a whole number ranging from 0 to 23 that represents the hour of day of a given time. The required parameter, ''time'', can be any numeric or string expression, or any expression that represents a time.


== Example ==
== Example (Basic) ==


<pre>
<pre>
Rem Hour Example
Rem Hour Example
'Hour returns hour of day from a time
'Hour returns hour of day from a time
Print "Hour of " & FormatDateTime(Now,4) & _ "is " & Hour(Now)
Print "Hour of " & FormatDateTime(Now,4) & " is " & Hour(Now)
</pre>
</pre>


Line 22: Line 24:
== Related Items ==
== Related Items ==


[[day|DAY]], [[minute|MINUTE]], [[month|MONTH]], [[now|NOW]], [[second|SECOND]], [[time|TIME]], [[year|YEAR]]
[[day|Day]], [[minute|Minute]], [[month|Month]], [[now|Now]], [[second|Second]], [[time|Time]], [[year|Year]]


[[Category:Language Reference]]
[[Category:Language Reference]]
[[Category:Date and Time]]
[[Category:BASIC Functions]]

Latest revision as of 15:26, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

Hour(time)

Description

Hour returns a whole number ranging from 0 to 23 that represents the hour of day of a given time. The required parameter, time, can be any numeric or string expression, or any expression that represents a time.

Example (Basic)

Rem Hour Example
'Hour returns hour of day from a time
Print "Hour of " & FormatDateTime(Now,4) & " is " & Hour(Now)

Output

The Hour of 8/18/1998 10:52:44 PM is 22
(sample date output is system dependant)

Related Items

Day, Minute, Month, Now, Second, Time, Year