code: public static Date parseW3CDateTime(String sDate, final Locale locale) {
          // if sDate has time on it, it injects 'GTM' before de TZ displacement to allow the
          // SimpleDateFormat parser to parse it properly
          final int tIndex = sDate.indexOf("T");
          if (tIndex > -1) {
              if (sDate.endsWith("Z")) {
                  sDate = sDate.substring(0, sDate.length() - 1) + "+00:00";
              }
              int tzdIndex = sDate.indexOf("+", tIndex);
              if (tzdIndex == -1) {
                  tzdIndex = sDate.indexOf("-", tIndex);
              }
              if (tzdIndex > -1) {
                  String pre = sDate.substring(0, tzdIndex);
                  final int secFraction = pre.indexOf(",");
                  if (secFraction > -1) {
                      pre = pre.substring(0, secFraction);
                  }
                  final String post = sDate.substring(tzdIndex);
                  sDate = pre + "GMT" + post;
              }
          } else {
              sDate += "T00:00GMT";
          }
          return parseUsingMask(W3CDATETIME_MASKS, sDate, locale);
      }
docs: Parses a Date out of a String with a date in W3C date-time format.
  <p/>
  It parsers the following formats:
  <ul>
  <li>"yyyy-MM-dd'T'HH:mm:ssz"</li>
  <li>"yyyy-MM-dd'T'HH:mmz"</li>
  <li>"yyyy-MM-dd"</li>
  <li>"yyyy-MM"</li>
  <li>"yyyy"</li>
  </ul>
  <p/>
  Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
  <p/>
  
  @param sDate string to parse for a date.
  @return the Date represented by the given W3C date-time string. It returns <b>null</b> if it
  was not possible to parse the given string into a Date.