- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
PriceWithInterval pwi = new PriceWithInterval();
pwi.setPrice(p);
pwi.setStart(dateFormat.parse(dateFormat.format(p.getStartDate())).getTime());
Long endTm = dateFormat.parse(dateFormat.format(p.getEndDate())).getTime();
//Больше 50 лет - техническая бесконечность
if (((endTm-pwi.getStart())/1000/3600/24/365)>50)
{
endTm = dateFormat.parse("31.12.9999").getTime();
}
// Где dateFormat объявлен как
new SimpleDateFormat("dd.MM.yyyy");