int getHour(DateTime date)
int getHour(DateTime date)
Name | Type | Description |
---|---|---|
date | DateTime | A DateTime to get the hour of. |
Type | Description |
---|---|
int | The hour on the date argument. Hour in day ranges from 0-23. |
DateTime dateNow = DateTime.now ();
int hour = DateTime.getHour (dateNow);
Result is:
hour contains: 14 if it is "2004-03-11 14:59:04" now