year()#

Py5 communicates with the clock on your computer.

Examples#

1def setup():
2    d = py5.day()    # values from_ 1 - 31
3    m = py5.month()  # values from_ 1 - 12
4    y = py5.year()   # 2003, 2004, 2005, etc.
5
6    py5.text(str(d), 10, 28)
7    py5.text(str(m), 10, 56)
8    py5.text(str(y), 10, 84)

Description#

Py5 communicates with the clock on your computer. The year() function returns the current year as an integer (2003, 2004, 2005, etc).

Underlying Processing method: year

Syntax#

year() -> int

Updated on November 12, 2021 11:30:58am UTC