title: Serialize ZonedDateTime in Kotlin data class
body: <p>I get the following error when I serialize a <code>ZonedDateTime</code> field in a data class:</p>
  <pre><code>Type mismatch: inferred type is KClass&lt;ZonedDateTimeSerializer&gt; but KClass&lt;out KSerializer&lt;*&gt;&gt; was expected
  </code></pre>
  <p>Here is my class:</p>
  <pre><code>import com.fasterxml.jackson.datatype.jsr310.ser.ZonedDateTimeSerializer
  import kotlinx.serialization.Serializable
  import java.time.ZonedDateTime
  
  @Serializable
  data class MyClass(
      @Serializable(ZonedDateTimeSerializer::class)
      val time: ZonedDateTime
  )
  </code></pre>
  <p>How can I serialize a <code>ZonedDateTime</code> in Kotlin?</p>