Notes
Returns the year component of a Date or Datetime as an integer.
Here are some examples:
date myDate = date.newInstance(1983, 3, 12);
Integer year = myDate.year();
system.debug(year);
datetime myDatetime = datetime.newInstance(1983, 3, 12,8,20,45);
Integer year = myDatetime.year();
system.debug(year);
Output: 1983
Video
Video does not exists.