Returns the date represented by this duration ago. @return the computed date
()
| 121 | * @return the computed date |
| 122 | */ |
| 123 | @Override |
| 124 | public Date getAgo() { |
| 125 | final Calendar cal = Calendar.getInstance(); |
| 126 | |
| 127 | cal.add(Calendar.DAY_OF_YEAR, -this.getDays()); |
| 128 | cal.add(Calendar.HOUR_OF_DAY, -this.getHours()); |
| 129 | cal.add(Calendar.MINUTE, -this.getMinutes()); |
| 130 | cal.add(Calendar.SECOND, -this.getSeconds()); |
| 131 | cal.add(Calendar.MILLISECOND, -this.getMillis()); |
| 132 | |
| 133 | return cal.getTime(); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Returns a helper for computing dates relative to now. |
nothing calls this directly
no test coverage detected