title: How to check whether time exists?
body: <pre><code>frdt = req.getParameter("[FRDT]");
  
  
          if(isValidDate(frdt)){
              frdt = req.getParameter("[FRDT]");
          }else{
              frdt = formatDt(frdt);
          }
  
      private static boolean isValidDate(String input) {
      String formatString = "YYYY-MM-dd";
  
      try {
          SimpleDateFormat format = new SimpleDateFormat(formatString);
         format.setLenient(true);
          format.parse(input);
      } catch (ParseException e) {
          return false;
      } catch (IllegalArgumentException e) {
          return false;
      }
  
      return true;
  }
  </code></pre>
  
  <p>My input for frdt (input date) will be 2017-03-27 11:33:21 or only 2017-03-27.
  but i have two condition, if only '2017-03-27' without time, it only will run</p>
  
  <pre><code>frdt = req.getParameter("[FRDT]");
  </code></pre>
  
  <p>if the date including date and time, it will add 'T' before time.</p>
  
  <p>How to validate the input whethere include time or not?</p>
  
  <p>Please kindly advice.</p>
  
  <p>Thanks and best regards
  Sharon</p>