Returns the date obtained by adding this duration to today. @return the computed date
()
| 178 | * @return the computed date |
| 179 | */ |
| 180 | @Override |
| 181 | public Date getNow() { |
| 182 | final Calendar cal = Calendar.getInstance(); |
| 183 | |
| 184 | cal.add(Calendar.DAY_OF_YEAR, Duration.this.getDays()); |
| 185 | |
| 186 | cal.set(Calendar.HOUR_OF_DAY, 0); |
| 187 | cal.set(Calendar.MINUTE, 0); |
| 188 | cal.set(Calendar.SECOND, 0); |
| 189 | cal.set(Calendar.MILLISECOND, 0); |
| 190 | |
| 191 | return new Date(cal.getTimeInMillis()); |
| 192 | } |
| 193 | }; |
| 194 | } |
| 195 | } |