year()

Py5 communicates with the clock on your computer.

Examples

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

    py5.text(str(d), 10, 28)
    py5.text(str(m), 10, 56)
    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 Java method: year

Syntax

year() -> int

Updated on September 11, 2021 16:51:34pm UTC