title: Override the layout used by json.Marshal to format time.Time
body: <p>In Golang, is there a way to make the generic <code>encoding/json</code> Marshal to use a different layout when Marshaling the <code>time.Time</code> fields?</p>
  
  <p>Basically I have this struct:</p>
  
  <pre><code>s := {"starttime":time.Now(), "name":"ali"}
  </code></pre>
  
  <p>and I want to encoding to json using <code>encdoding/json</code>'s <code>Marshal</code> function, but I want to use my custom layout, I imagine somewhere <code>time.Format(layout)</code> is being called, I want to control that layout,</p>