This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

Name

year()

Examples
int d = day();    // Values from 1 - 31
int m = month();  // Values from 1 - 12
int y = year();   // 2003, 2004, 2005, etc.

String s = String.valueOf(d);
text(s, 10, 28);
s = String.valueOf(m);
text(s, 10, 56); 
s = String.valueOf(y);
text(s, 10, 84);
Description Processing communicates with the clock on your computer. The year() function returns the current year as an integer (2003, 2004, 2005, etc).
Syntax
year()
Returnsint
Relatedmillis()
second()
minute()
hour()
day()
month()
Updated on July 4, 2018 11:56:42am EDT

Creative Commons License