code: public Calendar deserialize(String serString) throws ValueFormatException
     {
        final String[] parts = serString.split(CALENDAR_FIELDS_SEPARATOR);
        if (parts.length == 2)
        {
  
           // try parse serialized string with two formats
           // 1. Complete ISO 8610 compliant
           // 2. Complete ISO 8610 + RFC822 (time zone) compliant (JCR 1.6 and prior)
           Calendar isoCalendar = null;
           try
           {
              isoCalendar = ISO8601.parse(parts[0], JCR_FORMATS);
  
              String[] calendarFields = parts[1].split(CALENDAR_FIELDS_DELIMITER);
              if (calendarFields.length == 4)
              {
                 try
                 {
                    isoCalendar.setLenient(Boolean.parseBoolean(calendarFields[0]));
                    isoCalendar.setFirstDayOfWeek(Integer.parseInt(calendarFields[1]));
                    isoCalendar.setMinimalDaysInFirstWeek(Integer.parseInt(calendarFields[2]));
  
                    isoCalendar.setTimeZone(Tools.getTimeZone(calendarFields[3]));
                 }
                 catch (Exception e)
                 {
                    log.warn("Can't parse serialized fields for the calendar [" + parts[1] + "] but calendar has ["
                       + isoCalendar.getTime() + "]", e);
                 }
              }
              else
              {
                 log.warn("Fields of the calendar is not serialized properly [" + parts[1] + "] but calendar has ["
                    + isoCalendar.getTime() + "]");
              }
           }
           catch (ParseException e)
           {
              throw new ValueFormatException(e);
           }
  
           return isoCalendar;
        }
        throw new ValueFormatException("Can't deserialize calendar string [" + serString + "]");
     }
docs: Deserialize string (of JCR Value) to the date.
  
  @param serString
  @return
  @throws ValueFormatException