Code example for SimpleDateFormat

Methods: parse

0
        } 
        return LogType.NOTE; 
    } 
 
    private static Date parseDate(final String date) {
        final SimpleDateFormat ISO8601DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault());
        final String strippedDate = date.replaceAll("\\+0([0-9]){1}\\:00", "+0$100");
        try { 
            return ISO8601DATEFORMAT.parse(strippedDate);
        } catch (ParseException e) {
            Log.e("OkapiClient.parseDate", e);
        } 
        return null; 
    } 
 
    private static void setLocation(final Geocache cache, final String location) {
        final String latitude = StringUtils.substringBefore(location, "|");
        final String longitude = StringUtils.substringAfter(location, "|");
        cache.setCoords(new Geopoint(latitude, longitude));
    }