fabianmoronzirfas
6/27/2017 - 5:39 AM

saveframe_with_timestamp.pde

void setup(){}
void draw() {}

void keyPressed() {
  if (key == 's' || key == 's') {
    String filename = "out-"+ timestamp() +".png";
    saveFrame(filename);
    println("Saved \"" + filename+ "\" to disk");
  }
}

String timestamp() {
  return year() +"-" + month() +"-" + day() +"-" + hour() +"-" + minute() +"-"+ second();
}