Code example for DateFormat

Methods: format, getTimeZone, setTimeZone

0
    private static String sYesterday;
    private static long sYesterdayMsec;
     
	private static String format(DateFormat dateformat, Date date, TimeZone timezone)
    { 
        TimeZone timezone1 = dateformat.getTimeZone();
        if(timezone != null)
            dateformat.setTimeZone(timezone);
        String s = dateformat.format(date);
        dateformat.setTimeZone(timezone1);
        return s;
    } 
 
    public static String getDateRange(Context context, EventTime eventtime, EventTime eventtime1, boolean flag)
    { 
        initializeStrings(context);
        long l = eventtime.getTimeMs().longValue();
        return String.format("%s %s", new Object[] {
            getSingleDateDisplayLine(context, l), getDisplayTime(context, l)
        }); 
    }