DateTime.getYear()

Signature

int getYear(DateTime date)

Domain

action, condition

Description

Gets the year on the DateTime Object passed as input.

Parameters

NameTypeDescription
dateDateTimeA DateTime to get the year of.

Returns

TypeDescription
intThe year on the date argument.

Cautions

none

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