If you think the Android project Feeder listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* $Id: $/*www.java2s.com*/
*
* Copyright (C) 2012 Stoyan Rachev (stoyanr@gmail.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/package com.stoyanr.feeder.util;
import java.util.Calendar;
import java.util.Date;
publicclass DateUtils {
private DateUtils() {
}
publicstaticboolean hasTimeElapsed(Date date, int field, int value) {
return (new Date()).after(add(date, field, value));
}
publicstatic Date add(Date date, int field, int value) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(field, value);
return cal.getTime();
}
}