bouncycastle uses the Date class, based off of UTC. Force all GregorianCalendars to use UTC, so get and set of key dates works as expected

This commit is contained in:
Ashley Hughes
2014-01-30 11:35:55 +00:00
parent 358ab7d7e4
commit 4119757699
4 changed files with 15 additions and 27 deletions

View File

@@ -29,25 +29,6 @@ import android.os.Bundle;
public class OtherHelper {
/**
* Return the number if days between two dates
*
* @param first
* @param second
* @return number of days
*/
public static long getNumDaysBetween(GregorianCalendar first, GregorianCalendar second) {
GregorianCalendar tmp = new GregorianCalendar();
tmp.setTime(first.getTime());
long numDays = (second.getTimeInMillis() - first.getTimeInMillis()) / 1000 / 86400;
tmp.add(Calendar.DAY_OF_MONTH, (int) numDays);
while (tmp.before(second)) {
tmp.add(Calendar.DAY_OF_MONTH, 1);
++numDays;
}
return numDays;
}
/**
* Logs bundle content to debug for inspecting the content
*