code: public static Date parseBasicTimestamp(String value) throws ParseException
     {
        Date result = null;
  
        if (value.length() > 0)
        {
           if (!value.equals("-1 -1") && !value.equals("0"))
           {
              DateFormat df;
              if (value.endsWith(" 0"))
              {
                 df = DATE_FORMAT1.get();
              }
              else
              {
                 if (value.indexOf(' ') == -1)
                 {
                    df = DATE_FORMAT2.get();
                 }
                 else
                 {
                    df = TIMESTAMP_FORMAT.get();
                    int timeIndex = value.indexOf(' ') + 1;
                    if (timeIndex + 6 > value.length())
                    {
                       String time = value.substring(timeIndex);
                       value = value.substring(0, timeIndex) + "0" + time;
                    }
                 }
              }
  
              result = df.parse(value);
           }
        }
  
        //System.out.println(value + "=>" + result);
        return result;
     }
docs: Parse a timestamp value.
  
  @param value timestamp as String
  @return timestamp as Date