Looking for "Missing" functions? System.currentTimeMillis(), printf(), format()?

edited December 2013 in Library Questions

Sorry if I'm not asking in the right place. I noticed that there are methods for day(), hour(), minute(), second(), but that I have to build up my own time by day() * 86400 + hour() * 3600 + ...

This seems silly as no doubt these functions all operate off some central clock. Is there a method somewhere that gives access to it?

Similar situation, is there any formatting code akin to DecimalFormat or (better) printf?

Answers

  • Answer ✓

    This is all available through Processing, it just isn't necessarily part of the documentation. I don't see how functions such as System.currentTimeMillis() are "missing" seeing as they are perfectly accessible, even if they haven't been wrapped into a PApplet function.

  • Just import the right Java libraries (use the import statement).

    See also Cannot find a class or type named "Xyz"

Sign In or Register to comment.