code: public static long getCalendarDate(CmsMessages messages, String dateString, boolean useTime) throws ParseException {
  
          long dateLong = 0;
  
          // substitute some chars because calendar syntax != DateFormat syntax
          String dateFormat = messages.key(org.opencms.workplace.Messages.GUI_CALENDAR_DATE_FORMAT_0);
          if (useTime) {
              dateFormat += " " + messages.key(org.opencms.workplace.Messages.GUI_CALENDAR_TIME_FORMAT_0);
          }
          dateFormat = CmsCalendarWidget.getCalendarJavaDateFormat(dateFormat);
  
          SimpleDateFormat df = new SimpleDateFormat(dateFormat);
          dateLong = df.parse(dateString).getTime();
          return dateLong;
      }
docs: Creates the time in milliseconds from the given parameter.<p>
  
  @param messages the messages that contain the time format definitions
  @param dateString the String representation of the date
  @param useTime true if the time should be parsed, too, otherwise false
  
  @return the time in milliseconds
  
  @throws ParseException if something goes wrong