public static String yearMonthDay(final long date) {
        final SimpleDateFormat pattern = new SimpleDateFormat(PATTERN_YYYYMMDD, Locale.getDefault());
        return date == 0 ? "" : pattern.format(date);
    }
returns given date in format yyyy-mm-dd, or empty string if 0 given

@param date Date to be formatted
@return String formatted date
main/src/main/java/cgeo/geocaching/utils/CalendarUtils.java