easy calculation of weeks of certain period with java -


is there easy library or approach week (from date ~ date) of periods?

example: there 6 weeks(variable) (start 1 july, 2012 ~ 11 aug, 2012).

i want cut off 6 weeks 2 portions (variable). results be

1) 1 july,2012 ~ 21 july, 2012  2) 22 july,2012 ~ 11 aug, 2012... etc 

with jodatime, can number of weeks between periods though.

all know start date , end date both variables , cutoffweeks amount(eg.6 weeks or 4 weeks).

final localdate start = new localdate(); final localdate end3 = start.plusweeks(3) 

its not clear want, joda-time makes things rather easy.

i guess need :

public void dostruff(int cutoff){   int portion = cutoff/2;   final localdate start = new localdate();   final localdate end = start.plusweeks(portion) } 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -