Skip to content

Instantly share code, notes, and snippets.

@cameronhotchkies
Created June 3, 2015 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronhotchkies/117e7c7ae608b32f35e8 to your computer and use it in GitHub Desktop.
Save cameronhotchkies/117e7c7ae608b32f35e8 to your computer and use it in GitHub Desktop.
Common Joda DateTime Mapping
import play.api.db.slick.Config.driver.simple._
import org.joda.time.DateTime
import java.sql.Timestamp
object SlickMapping {
implicit def jodaDateTimeMapping =
MappedColumnType.base[DateTime, Timestamp](
dt => new Timestamp(dt.getMillis),
ts => new DateTime(ts.getTime))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment