tumblr tracker

GetHour

Library Reference ›› DateTime ››
Parent Previous Next

DateTime.GetHour


Namespace: DateTime


Returns the hour value from a datetime variable.


retval = DateTime.GetHour(DateTime)


Parameters:

- DateTime; datetime variable or function call returning datetime variable; the datetime value to extract the day from


Returns:

Value between 0 and 23; numeric value.


Example


$val = DateTime.GetHour(DateTime.GetCurrentDateTime());


After execution the $val variable will contain the current hour value (0 to 23).