docs: public static Date stringToBinary(String tempString, Date dateOld, int spDateFormat) throws Exception
      {
          int sDateFormat = spDateFormat;
          Date date = null; //date.SetStatus(Date.null);
          synchronized (Converter.gCalendar)
          {
              if (tempString == null)
                  date = null;
              else if (tempString.equals(Constants.BLANK))
                  date = null;
              else
              {
                  if (gDateFormat == null)
                      initGlobals();
                  if (sDateFormat == DBConstants.HYBRID_DATE_TIME_FORMAT)
                      sDateFormat = DBConstants.LONG_DATE_TIME_FORMAT;
                  if (sDateFormat == DBConstants.LONG_DATE_TIME_FORMAT)
                  {
                      try   {
                          date = gLongDateTimeFormat.parse(tempString);
                      } catch (ParseException ex)   {
                          date = null;
                      }
                      if (date == null)
                          sDateFormat = DBConstants.DATE_TIME_FORMAT;
                  }
                  if (sDateFormat == DBConstants.DATE_TIME_FORMAT)
                  {
                      try   {
                          date = gDateTimeFormat.parse(tempString);
                      } catch (ParseException ex)   {
                          date = null;
                      }
                      if (date == null)
                      {
                          try   {
                              date = gDateShortTimeFormat.parse(tempString);
                          } catch (ParseException ex)   {
                              date = null;
                          }
                          if (date == null)
                              sDateFormat = DBConstants.DATE_ONLY_FORMAT;
                      }
                  }
                  if ((sDateFormat == DBConstants.DATE_ONLY_FORMAT) || (sDateFormat == DBConstants.DATE_FORMAT))
                  {
                      try   {
                          date = gDateFormat.parse(tempString);
                      } catch (ParseException ex)   {
                          date = null;
                      }
                      if (date == null)
                      {
                          try   {
                              date = gDateShortFormat.parse(tempString);
                          } catch (ParseException ex)   {
                              date = null;
                          }
                      }
                  }
                  if (sDateFormat == DBConstants.HYBRID_TIME_ONLY_FORMAT)
                      sDateFormat = DBConstants.LONG_TIME_ONLY_FORMAT;
                  if (sDateFormat == DBConstants.LONG_TIME_ONLY_FORMAT)
                  {
                      try   {
                          date = gLongTimeFormat.parse(tempString);
                      } catch (ParseException ex)   {
                          date = null;
                      }
                      if (date == null)
                          sDateFormat = DBConstants.TIME_ONLY_FORMAT;
                  }
                  if ((sDateFormat == DBConstants.TIME_ONLY_FORMAT) || (sDateFormat == DBConstants.TIME_FORMAT))
                  {
                      try   {
                              date = gTimeFormat.parse(tempString);
                          } catch (ParseException ex)   {
                              date = null;
                          }
                  }
                  if (date == null) 
                      if ((sDateFormat != DBConstants.DATE_ONLY_FORMAT) && (sDateFormat != DBConstants.DATE_FORMAT))
                  {   // Problem with time parsing - maybe am/pm was not there!
                      if (tempString.charAt(tempString.length() - 1) != 'M')
                          return DateConverter.stringToBinary(tempString + " AM", dateOld, spDateFormat);
                  }
                  if (date == null)
                      date = FieldInfo.stringToDate(tempString, sDateFormat); // Throw everything else I have at it.
              }
              // The following lines fix the year 2000 problem (ie., 2/15/02 -> 2/15/2002)
              if (date != null)
                  if ((sDateFormat != DBConstants.TIME_ONLY_FORMAT) && (sDateFormat != DBConstants.TIME_FORMAT))
              {
                  gCalendar.setTime(date);
                  int iYear = gCalendar.get(Calendar.YEAR);
                  if (iYear < 1950)
                  {
                      gCalendar.add(Calendar.YEAR, 100);
                      date = gCalendar.getTime();
                  }
              }
              // End of year 2000 Fix
              if (date == null)
                  return null;
              if (dateOld == null)
                  return date;    // Null, don't change
              if (date.getTime() != 0) if (dateOld.equals(date))
                  return date;
      
              if (dateOld.getTime() == 0)
              {
                  gCalendar.set(DBConstants.FIRST_YEAR, Calendar.JANUARY, 1, 0, 0, 0);
                  gCalendar.set(Calendar.MILLISECOND, 0);
                  dateOld = gCalendar.getTime();
              }
              if ((sDateFormat == DBConstants.DATE_ONLY_FORMAT) || (sDateFormat == DBConstants.TIME_ONLY_FORMAT))
              {
                  gCalendar.set(DBConstants.FIRST_YEAR, Calendar.JANUARY, 1, 0, 0, 0);
                  gCalendar.set(Calendar.MILLISECOND, 0);
                  dateOld = gCalendar.getTime();
              }
              if ((sDateFormat == DBConstants.DATE_FORMAT) || (sDateFormat == DBConstants.DATE_ONLY_FORMAT))
              {
                  gCalendar.setTime(dateOld);
                  int iHour = gCalendar.get(Calendar.HOUR_OF_DAY);
                  int iMinute = gCalendar.get(Calendar.MINUTE);
                  int iSecond = gCalendar.get(Calendar.SECOND);
                  int iMilliSecond = gCalendar.get(Calendar.MILLISECOND);
                  if (sDateFormat == DBConstants.DATE_ONLY_FORMAT)
                  {
                      iHour = DBConstants.HOUR_DATE_ONLY;
                      iMinute = 0;
                      iSecond = 0;
                      iMilliSecond = 0;
                  }
                  gCalendar.setTime(date);
                  int iYear =  gCalendar.get(Calendar.YEAR);
                  int iMonth =  gCalendar.get(Calendar.MONTH);
                  int iDate =  gCalendar.get(Calendar.DATE);
                  gCalendar.set(iYear, iMonth, iDate, iHour, iMinute, iSecond);
                  gCalendar.set(Calendar.MILLISECOND, iMilliSecond);
                  date = gCalendar.getTime();
              }
              if ((sDateFormat == DBConstants.TIME_FORMAT) || (sDateFormat == DBConstants.TIME_ONLY_FORMAT))
              {
                  gCalendar.setTime(date);
                  int iHour = gCalendar.get(Calendar.HOUR_OF_DAY);
                  int iMinute = gCalendar.get(Calendar.MINUTE);
                  int iSecond = gCalendar.get(Calendar.SECOND);
                  int iMilliSecond = gCalendar.get(Calendar.MILLISECOND);
                  gCalendar.setTime(dateOld);
                  int iYear =  gCalendar.get(Calendar.YEAR);
                  int iMonth =  gCalendar.get(Calendar.MONTH);
                  int iDate =  gCalendar.get(Calendar.DATE);
                  if (sDateFormat == DBConstants.TIME_ONLY_FORMAT)
                  {
                      iYear =  DBConstants.FIRST_YEAR;
                      iMonth =  Calendar.JANUARY;
                      iDate =  1;
                  }
                  int iOldHour = gCalendar.get(Calendar.HOUR_OF_DAY);
                  int iOldMinute = gCalendar.get(Calendar.MINUTE);
                  if ((iHour == iOldHour) && (iMinute == iOldMinute)
                      && (iSecond == 0) && (iMilliSecond == 0))
                  {   // If nothing has changed but the seconds and milliseconds, leave them the same (probably parsing a entered field)
                      iSecond = gCalendar.get(Calendar.SECOND);
                      iMilliSecond = gCalendar.get(Calendar.MILLISECOND);
                  }
                  gCalendar.set(iYear, iMonth, iDate, iHour, iMinute, iSecond);
                  gCalendar.set(Calendar.MILLISECOND, iMilliSecond);
                  date = gCalendar.getTime();
              }
          }
          return date;
      }