title: How to use Joda DateTime with Play Json
body: <p>I'm developing a Play application, and I'm trying to use a Joda DateTime object into my case class.</p>
  
  <pre><code>package model
  
  import org.joda.time.DateTime
  import play.api.libs.json._
  
  case class User(name: String, created: DateTime)
  
  object User {
    implicit val yourJodaDateReads = Reads.jodaDateReads("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
    implicit val yourJodaDateWrites = Writes.jodaDateWrites("yyyy-MM-dd'T'HH:mm:ss.SSSZ'")
    implicit val userFormat = Json.format[User]
  
    def main(args: Array[String]) {
  
    val value = Json.parse("{ \"name\" : \"hello\" , \"created\" : \"2015-07-16T20:32:04.046+02:00\" }")
  
    println(Json.toJson(new User("user", new DateTime())))
    println(Json.fromJson(value))
   }
  }
  </code></pre>
  
  <p>Based on this <a href="https://stackoverflow.com/questions/18255504/custom-jodatime-serializer-using-play-frameworks-json-library/28586712#28586712">solution</a>, I'm getting this error:</p>
  
  <pre><code>Error:(18, -1) Play 2 Compiler: 
   /activator-1.3.2/notifier-app/app/model/Test.scala:18: ambiguous implicit    values:
   both value yourJodaDateReads in object User of type =&gt; play.api.libs.json.Reads[org.joda.time.DateTime]
      and value userFormat in object User of type =&gt; play.api.libs.json.OFormat[model.User]
  </code></pre>
  
  <p>I'm using Activator 1.3.2 and Play 2.3.8. </p>
  
  <p>Could you please advice me ?</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>update</strong></p>
  
  <p>I understand there is a conflict with the implicit value in <em>play.api.libs.json.Reads</em></p>
  
  <pre><code>implicit val DefaultJodaDateReads = jodaDateReads("yyyy-MM-dd") 
  </code></pre>
  
  <p>How can I resolve this issue ?</p>