I would like to format MappedDateTime objects just like it is done in java:
val sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z")
sdf.format((new Date()))
How is it done with MappedDateTime in lift?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As MappedDateTime is a container for a Java
Date, then you can just use tools of Java for dates. However, when reading the liftweb api forMappedDateTime, there are the following methods which can help you:def format (d: Date): String: This method defines the string parsing semantics of this field
def parse (s: String): Box[Date]: This method defines the string parsing semantics of this field.
So, you can override those methods if you want to change their behavior.