year()
Returns the current year as a number such as 1999.
Examples

function setup()
size(100, 100)
background(200)
fill(0)
-- Get the current year.
local y = year()
-- Style the text.
textAlign(LEFT, CENTER)
textSize(12)
-- Display the year.
text('Current year: '..y, 10, 50, 80)
describe('The text "Current year: '..y..'" written in black on a gray background.')
end
Returns
Integer: current year.
Related
This reference page contains content adapted from p5.js and Processing by p5.js Contributors and Processing Foundation, licensed under CC BY-NC-SA 4.0.