Code example for GregorianCalendar

Methods: getTimeInMillis, setTimeInMillis

0
 
		String lastReplication = prefs.getString("lastReplicationTime", "0");
 
		long milliseconds = Long.parseLong(lastReplication);
 
		GregorianCalendar lastReplicationTime = new GregorianCalendar();
		lastReplicationTime.setTimeInMillis(milliseconds);
		return lastReplicationTime;
	} 
 
 
	/** 
	 *  
	 * @param applicationContext 
	 * @return Long - minutes since background replication task ran last 
	 */ 
	private int minutesSinceLastReplication(Context applicationContext) {
		GregorianCalendar lastReplication = getLastreplication(applicationContext);
		GregorianCalendar now = new GregorianCalendar();
 
		long timePassedSinceLastReplication = now.getTimeInMillis() - lastReplication.getTimeInMillis();
		//		ApplicationLog.i(" Time passed since last replication: " + timePassedSinceLastReplication.toString()); 
		long timePassedSinceLastRpelicationMinutes = (timePassedSinceLastReplication/1000)/60;
		return (int)timePassedSinceLastRpelicationMinutes;
	} 
	/**