tumblr tracker

GetYear

Library Reference ›› DateTime ››
Parent Previous Next

DateTime.GetYear


Namespace: DateTime


Returns the year value from a datetime variable.


retval = DateTime.GetYear(DateTime)


Parameters:

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


Returns:

The year value; numeric value.


Example


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


After execution the $val variable will contain the current year.