Reference×
Reference
- [] (array access)
- = (assign)
- catch
- class
- , (comma)
- // (comment)
- {} (curly braces)
- /** */ (doc comment)
- . (dot)
- draw()
- exit()
- extends
- false
- final
- implements
- import
- loop()
- /* */ (multiline comment)
- new
- noLoop()
- null
- () (parentheses)
- popStyle()
- pop()
- private
- public
- pushStyle()
- push()
- redraw()
- return
- ; (semicolon)
- setLocation()
- setResizable()
- setTitle()
- setup()
- static
- super
- this
- thread()
- true
- try
- void
Name
year()
Description
Processing communicates with the clock on your computer. The year() function returns the current year as an integer (2003, 2004, 2005, etc).
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);
Syntax
year()
Return
int

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.