Code example for Time

Methods: normalize, set, switchTimezone

0
    	return c.getTimeInMillis();
    } 
     
    public static long convToEnglishTime(long dateMsec) {
    	Time androTime;
    	androTime = new Time();
    	androTime.switchTimezone(TimeZone.getDefault().getDisplayName(Locale.ENGLISH));
    	androTime.set(dateMsec);
 
    	return androTime.normalize(true);
    } 
     
    public static DateTime getRoundedCurrentDateTime() { 
        final Calendar cal = Calendar.getInstance();
        if (cal.get(Calendar.MINUTE) != 0) {
        	cal.add(Calendar.HOUR_OF_DAY, 1);
        	cal.set(Calendar.MINUTE, 0);
        } 
         
    	return getDateTimeFromCal(cal);
    }