title: How to represent the RFC-3339 `-00:00` offset in Go?
body: <p>RFC-3339 Section 4.3 (<a href="https://www.rfc-editor.org/rfc/rfc3339#section-4.3" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc3339#section-4.3</a>) defines the <code>-00:00</code> offset as the following, which is different than <code>Z</code> or <code>+00:00</code>.</p>
  <pre><code>4.3. Unknown Local Offset Convention
  
     If the time in UTC is known, but the offset to local time is unknown,
     this can be represented with an offset of &quot;-00:00&quot;.  This differs
     semantically from an offset of &quot;Z&quot; or &quot;+00:00&quot;, which imply that UTC
     is the preferred reference point for the specified time.  RFC2822
     [IMAIL-UPDATE] describes a similar convention for email.
  </code></pre>
  <p>However, I'm not sure how to represent this in Go. When I parse a time with <code>-00:00</code> and format it, I get a <code>Z</code> offset. For example:</p>
  <ul>
  <li>Input: <code>2018-01-01T00:00:00-00:00</code></li>
  <li>Output: <code>2018-01-01T00:00:00Z</code></li>
  </ul>
  <p>Here's some example code (<a href="https://play.golang.org/p/CVmNnhaSiiT" rel="nofollow noreferrer">https://play.golang.org/p/CVmNnhaSiiT</a>):</p>
  <pre><code>package main
  
  import (
      &quot;fmt&quot;
      &quot;time&quot;
  )
  
  func main() {
      t := &quot;2018-01-01T00:00:00-00:00&quot;
      fmt.Println(&quot;Input  &quot; + t)
      p, err := time.Parse(time.RFC3339, t)
      if err != nil {
          fmt.Println(err)
      } else {
          t2 := p.Format(time.RFC3339)
  
          fmt.Println(&quot;Output &quot; + t2)
      }
  }
  </code></pre>