title: How to parse non standard time format from json
body: <p>lets say i have the following json</p>
  
  <pre><code>{
      name: "John",
      birth_date: "1996-10-07"
  }
  </code></pre>
  
  <p>and i want to decode it into the following structure</p>
  
  <pre><code>type Person struct {
      Name string `json:"name"`
      BirthDate time.Time `json:"birth_date"`
  }
  </code></pre>
  
  <p>like this</p>
  
  <pre><code>person := Person{}
  
  decoder := json.NewDecoder(req.Body);
  
  if err := decoder.Decode(&amp;person); err != nil {
      log.Println(err)
  }
  </code></pre>
  
  <p>which gives me the error <code>parsing time ""1996-10-07"" as ""2006-01-02T15:04:05Z07:00"": cannot parse """ as "T"</code></p>
  
  <p>if i were to parse it manually i would do it like this</p>
  
  <pre><code>t, err := time.Parse("2006-01-02", "1996-10-07")
  </code></pre>
  
  <p>but when the time value is from a json string <strong>how do i get the decoder to parse it in the above format?</strong></p>