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.
If you mean to obtain the values Calendar
have all fields related to time management, with some simple reflection you can do
Field[] fields = Calendar.class.getFields();
for (Field f : fields)
{
String fName = f.toString();
System.out.println(fName.substring(fName.lastIndexOf('.')+1).replace("_", " ").toLowerCase());
}
this will output:
era
year
month
week of year
week of month
date
day of month
day of year
day of week
day of week in month
am pm
hour
hour of day
minute
second
millisecond
zone offset
dst offset
field count
sunday
monday
tuesday
wednesday
thursday
friday
saturday
january
february
march
april
may
june
july
august
september
october
november
december
undecimber
am
pm
all styles
short
long
from which you can exclude what you don't need.
If you need just constants you have them: Calendar.DAY_OF_MONTH
, Calendar.YEAR
and so on..