title: Validating Timestamp format yyyy-MM-dd'T'HH:mm:ssZ in java?
body: <p>I'm trying to do a <strong>timestamp</strong> validation using <strong>joda time-1.6.2</strong>. Please point my error and help me out.
  <strong>Code</strong></p>
  
  <pre><code>String timestamp = "2014-09-23T23:03:11Z";
  String datePattern = "yyyy-MM-dd'T'HH:mm:ssZ";
  
  try {
               DateTimeFormatter dateFormatter = DateTimeFormat.forPattern(datePattern);
               dateFormatter.parseDateTime(timestamp);
  
          } catch (Exception e) {
              LOG.info("Timestamp is invalid format" + e);
          }
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>INFO: Timestamp is invalid formatjava.lang.IllegalArgumentException: Invalid format: "2014-09-23T23:03:11Z" is malformed at "Z"
  </code></pre>