3.5.9.6 Hour


Description

Returns the hour as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).


See this note.

Syntax

int Hour(double d[, int elapsed])

Parameters

d

Julian date-value, which can include time

elapsed

Optional argument, 1 to return elapsed time period

Return

If input is a valid Julian-date value, returns the hour, 0 (12:00 A.M.) to 23 (11:00 P.M.).

If input is not a valid Julian-date value, returns -1.

Example

int aa = Hour(0.6997854);
aa = ;//Should return the hour of this time, 16.
int bb = Hour(2454827.5982639);
bb = ; //Should return the hour of this time, 14.
double dTime = Time(25:30:21);
Hour(dTime, 1)= ; //25

See Also

Year, Month, Day, Minute, Second, Now