public static String yearMonth(final long date) {
        final DateFormat dateFormat = new SimpleDateFormat(PATTERN_YYYYMM, Locale.getDefault());
        return 0 == date ? "" : dateFormat.format(date);
    }
returns given date in format yyyy-mm, 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