code: @Nullable
    public static OffsetDateTime parseOffsetDateTimeUsingMask (@Nonnull final PDTMask <?> [] aMasks,
                                                               @Nonnull @Nonempty final String sDate)
    {
      for (final PDTMask <?> aMask : aMasks)
      {
        final DateTimeFormatter aDTF = PDTFormatter.getForPattern (aMask.getPattern (), LOCALE_TO_USE);
        try
        {
          final Temporal ret = aDTF.parse (sDate, aMask.getQuery ());
          if (LOGGER.isDebugEnabled ())
            LOGGER.debug ("Parsed '" + sDate + "' with '" + aMask.getPattern () + "' to " + ret.getClass ().getName ());
          return TypeConverter.convert (ret, OffsetDateTime.class);
        }
        catch (final DateTimeParseException ex)
        {
          if (LOGGER.isDebugEnabled ())
            LOGGER.debug ("Failed to parse '" + sDate + "' with '" + aMask.getPattern () + "': " + ex.getMessage ());
        }
      }
      return null;
    }
docs: Parses a Date out of a string using an array of masks. It uses the masks in
  order until one of them succeeds or all fail.
  
  @param aMasks
  array of masks to use for parsing the string
  @param sDate
  string to parse for a date.
  @return the Date represented by the given string using one of the given
  masks. It returns <b>null</b> if it was not possible to parse the
  the string with any of the masks.