Home Cooker Classes Others Rice CookerGX
Classes  >  datetime  >  Year
datetime class : Year getter

Description

Gets the year portion represented by this instance.

Syntax

datetimeInstance.Year

Arguments

None

Return value

ClassDescription
intYear portion of datetime (from 1 to 9999)

Sample code

datetime dt = new datetime(2016, 3, 4, 4, 13, 0);

int year = dt.Year;//2016

Notes

It's a wrapper of the System.DateTime.Year.

Links for reference

Copyright © Rice All rights reserved.