title: Invalid DateTime error while trying to insert datetime value into BigQuery from Dataflow
body: <p>We wrote a Google Data Flow code that inserts  a value into a bigquery 
   table whose column is of type DateTime. 
   The logic was running fine most of the times.
   But suddenly we get Invalid DateTime issue.</p>
  
  <pre><code>Exception: java.lang.RuntimeException: java.io.IOException: Insert failed: [{"errors":[{"debugInfo":"generic::out_of_range: Invalid datetime string \"2017-09-26T21:16\"
  </code></pre>
  
  <p>It is unclear how and why the above value is invalid.
  We see that it is adhering to DateTime datatype mentioned in <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types" rel="noreferrer">https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types</a></p>
  
  <p>Also it remains unclear why it is throwing this error only on occasions.</p>
  
  <p>We wrote a custom Transformation code that extends DoFn
  The ProcessElement code goes like this</p>
  
  <pre><code> public void processElement(ProcessContext c) throws Exception {
  
      TableRow tableRow = c.element();
      try {
         // do some processing then 
        tableRow.set("PredictedDate",**LocalDateTime.now().toString()**);
        c.output(tableRow);
      }catch(Exception exc){
          LOG.error("Exception while processing and hence not attempting to write to bigquery");
      }
  } 
  
  enter code here
  </code></pre>
  
  <p>It was working fine but fails occasionally during night times(US Central timezone).
  Can you please help us find the root cause.</p>