DateTimeFunctions.

GetHour(DateTime) Method

Summary

Gets the hour component of the specified date.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Functions
Containing Type
DateTimeFunctions

Syntax

[Function("get-hour")]
public static int GetHour(DateTime date)

Attributes

Type Description
FunctionAttribute Indicates that the method should be exposed as a function in NAnt build files.

Parameters

Name Type Description
date DateTime The date of which to get the hour component.

Return Value

Type Description
int The hour, between 0 and 23.