Click or drag to resize

Hour Function

X#
Returns the hour portion from a DateTime expression.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION Hour(
	tExpression AS DateTime
) AS LONG
Request Example View Source

Parameters

tExpression
Type: DateTime
Specifies a DateTime expression from which Hour( ) returns the hour.

Return Value

Type: Long
Numeric
Remarks
Hour( ) returns a numeric value based on a 24 hour format, and is not affected by the current setting of SET HOURS. For example, if SET HOURS is 12 or 24, the following command returns 13:
X#
1? Hour({^1998-02-16 1:00p})
Examples
X#
1CLEAR
2? Hour(DateTime( ))
3? Hour({^1998-02-16 10:42a})  // Displays 10
See Also