Code example for Time

Methods: setToNow

0
	} 
	@SuppressWarnings({ "deprecation" }) 
	private String formatDateForDisplay(Date date) {
		String since= "";
		//Setup 
		Time now = new Time();
		int dif = 0;
		now.setToNow();
		dif = now.hour-date.getHours();
		if(dif<0) {
			since = "invalid";
		} 
		else if(dif<24) {
			since = "hour";
		} 
		else if (dif<168) {
			dif/=24;
			since = "day";
		} 
		else if (dif<720) {
			dif/=168;