You might want to use the java.sql.Timestamp class which the Postgres
driver supports.
It's also possible to add support for Timestamp to your companion
object by adding these methods:
import play.db.anorm._
import play.db.anorm.defaults._
import scala.reflect.Manifest
import java.sql.{Timestamp}
override def extendExtractor[C](f:(Manifest[C] =>
Option[ColumnTo[C]]), ma:Manifest[C]):Option[ColumnTo[C]] = (ma match
{
case m if m == Manifest.classType(classOf[Timestamp]) =>
Some(rowToTimestamp)
case _ => None
}).asInstanceOf[Option[ColumnTo[C]]]
def rowToTimestamp: Column[Timestamp] = {
Column[Timestamp](transformer = { (value, meta) =>
val MetaDataItem(qualified,nullable,clazz) = meta
value match {
case time:java.sql.Timestamp => Right(time)
case _ => Left(TypeDoesNotMatch("Cannot convert " + value + " to
Timestamp for column " + qualified))
}
})
}
The mechanism for this changed in the latest git release, though.