I’m working on a functionality related to job scheduling in Java, where I’m required to schedule jobs based on days, weeks, or hours.
I’m running into 2 problems:
-
What is a good representation/library to handle a duration of time (not date)?
-
What is a good library to parse a text representation of time, i.e. 2d 3wk for 3 weeks and 2 days? similary to what JIRA has for their.
I’m thinking this must’ve been done before, but I can’t seem to find the correct word to google it.
The JODA time library http://joda-time.sourceforge.net/ gives some nice Java time functionality. You may have to write some regular expressions to parse the type of text strings you’re talking about though.
For scheduling the jobs, the Quartz scheduler http://www.opensymphony.com/quartz/;jsessionid=LDKHONNCOPJC may be useful to you.