Date and Time with play framework?
I want to separated fields in my model: action开发者_JAVA百科Date and actionTime. Can I use the datatypes sql.Date and sql.Time for this? Or should I use util.Date for both? What's the correct way?
Thanks a lot,
joe
java.util.Date is probably the right choice. However, the question is why do you want a separate date and time in your model. A better pattern would be to have a single Date object that contained the date and time, and if you need setters/getters to interrogate the separate parts of the date/time, then you can do so.
There is nothing to stop you from using setters/getters in Play.
You should definitely use java.utils.
EDIT: OK, to clarify, java.utils.Date is the one used (commonly) with Play Model.
精彩评论