title: Scala/Jerkson: Specifying the format of Date objects in Json
body: <p>I am serializing an object containing a <code>Date</code> using the <a href="https://github.com/codahale/jerkson" rel="nofollow">Jerkson Json library</a> (wrapper for <a href="http://wiki.fasterxml.com/JacksonHome" rel="nofollow">Jackson</a>):</p>
  
  <pre><code>import com.codahale.jerkson.Json
  import java.util.Date
  
  case class JTest(
      val dTest: Date
  )
  
  val jt = new JTest(new Date())
  println(Json.generate(jt))
  </code></pre>
  
  <p>Which results in:</p>
  
  <pre><code>{"dTest":1353576079168}
  </code></pre>
  
  <p><strong>Is there any way I can specify the format or override the generating function?</strong></p>
  
  <p>I realize that Json doesn't have a proper Date type, so the output (unix time in millis) is "correct". I'd like to have my Dates serialized as strings in the <a href="http://en.wikipedia.org/wiki/ISO_8601" rel="nofollow">ISO 8601</a> (with time/timezone) format: <code>2007-04-05T01:12:22+0100</code>, as it's easily parsed and human readable. <code>Date</code>'s toString spits out <code>Thu Nov 22 10:27:54 CET 2012</code>.</p>