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

Name

day()

Examples
void setup() {
  PFont metaBold;
  metaBold = loadFont("fonts/Meta-Bold.vlw.gz"); 
  setFont(metaBold, 44); 
  noLoop();
}

void draw() {
  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 day() function returns the current day as a value from 1 - 31.
Syntax
day()
Returnsint
Relatedmillis()
second()
minute()
hour()
month()
year()
Updated on May 19, 2014 05:29:59pm PDT

Creative Commons License