We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Is there a way to make a time calculator in processing? I'd like to be able to +,- hours, minutes and seconds. Any help is appreciated! Thanks
Answers
Please describe your situation more clearly.
Processing provides several functions for accessing the current time, such as
minute()
. These functions should be sufficient for identifying the current time...If you want additional date / time manipulation functionality, then I recommend the Java library Joda-Time. It is far better organized than Java's
Date
implementation. Keep in mind that this includes lots of additional functionality and so may not be appropriate for all situations...Thanks for your reply! For example... if you entered 1h + 30m + 30s it would say in a box 1h30m30s Thanks! I hope I've helped
Your example is too trivial, I suppose you want to add 1 h + 121 min + 222 s for example...
Simplest way would be to convert all values to seconds, add them, then decompose back to minutes, hours and days. The % operator is useful for the last step.