title: BigQuery: Format ISO Date
body: <p>I'm trying to parse a timestamp which is in ISO Date 8601 format.</p>
  <p>Example: <code>2021-04-10T14:11:00Z</code></p>
  <p>This information is stored inside a JSON object and for that reason I'm extracting that data as a string:</p>
  <p>The format I'm looking for is a yy-MM-dd hh:mm format and for that I've tried the following</p>
  <p><strong>SQL CODE</strong></p>
  <pre><code>SELECT document_id,
  json_extract(data, '$.Pair') as pair, 
  PARSE_TIMESTAMP('%y-%m-%d %H:%M', json_extract(data, '$.AlertTime')) as alerttime,
  COUNT(document_id) as alert_count
  FROM `tradingview-alerts-26eb8.alltables.TradingView_000_raw_latest` as alert_view
  GROUP BY alerttime, document_id, pair
  </code></pre>
  <p><strong>Errors</strong></p>
  <p>The code from above causes the following error:</p>
  <blockquote>
  <p>Failed to parse input string '&quot;2021-04-10T03:17:00Z&quot;</p>
  </blockquote>
  <p>The reason for this is the <strong>T</strong> in the middle of the date, I believe,</p>
  <p>In order to discard that I tried this change:</p>
  <pre><code>SUBSTR(json_extract(data, '$.AlertTime'), 1, 10))
  </code></pre>
  <p>But with that I'm getting an error on a different row:</p>
  <blockquote>
  <p>Failed to parse input string '&quot;2021-04-1'</p>
  </blockquote>
  <p>I'm wondering if it is because of how the date is being presented (year-month-date) the date not having 2 digits? such as 2021-04-01 instead of 2021-04-1.</p>
  <p>However if I try with</p>
  <pre><code>SUBSTR(json_extract(data, '$.AlertTime'), 1, 11))
  </code></pre>
  <p>The error I'm getting is</p>
  <blockquote>
  <p>Failed to parse input string '&quot;2021-04-10'</p>
  </blockquote>