DateTime.getYear()
Signature
int getYear(DateTime date)
Description
Gets the year on the DateTime Object passed as input.
Parameters
Name | Type | Description |
date | DateTime | A DateTime to get the year of. |
Returns
Type | Description |
int | The year on the date argument. |
Example
DateTime dateNow = DateTime.now ();
int year = DateTime.getYear (dateNow);
Result is:
year contains: 2004 if it is "2004-03-11 14:59:04" now