Skip to content

Commit c6fd90f

Browse files
committed
TypeBinder[ZonedDateTime] is pre-defined
1 parent 80f7097 commit c6fd90f

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/it/scala/scalikejdbc/bigquery/Post.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package scalikejdbc.bigquery
22

3-
import java.time.{ZoneId, Instant, ZonedDateTime}
3+
import java.time.ZonedDateTime
44

55
import scalikejdbc._
66

@@ -21,8 +21,6 @@ object Post extends SQLSyntaxSupport[Post] {
2121
override val columns = Seq("id", "body", "posted_at")
2222

2323
implicit val postIdBinders: Binders[PostId] = Binders.int.xmap(PostId.apply, _.value)
24-
implicit val zonedDateTimeTypeBinder: TypeBinder[ZonedDateTime] =
25-
TypeBinder.jodaDateTime.map(t => ZonedDateTime.ofInstant(Instant.ofEpochMilli(t.getMillis), ZoneId.of("UTC")))
2624

2725
val p = this.syntax("p")
2826

src/it/scala/scalikejdbc/bigquery/QueryDSLIntegration.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class QueryDSLIntegration extends FlatSpec with BigQueryFixture {
6464
.list
6565
.run(executor)
6666

67-
val result = response.result
67+
// handle environment-dependent TimeZone difference
68+
val result = response.result.map(p => p.copy(post = p.post.copy(postedAt = p.post.postedAt.withZoneSameInstant(ZoneId.of("UTC")))))
6869

6970
assert(result.size == 3)
7071

0 commit comments

Comments
 (0)