Is there a Java package with all the annoying time constants like milliseconds/seconds/minutes in a minute/hour/day/year? I\'d hate to duplicate something like that.
60 * 1000 miliseconds in 1 minute
60 seconds in 1 minute
1 minute in 1 minute
1/60 hours in 1 minute
1/(60*24) days in 1 minute
1/(60*24*365) years in 1 minute
1/(60*24*(365 * 4 + 1)) 4 years in 1 minute
* 60 is in 1 hour
* 60 * 24 is in 1 day
* 60 * 24 * 365 is in 1 year
etc.
Create them yourself, I guess, is the easiest. You can use the Date and Calendar classes to perform calculations with time and dates. Use the long data type to work with large numbers, such as miliseconds from 1 Januari 1970 UTC, System.currentTimeMillis().