Date and time with playback frame?

I want to separate the fields in my model: actionDate and actionTime. Can I use sql.Date and sql.Time data types for this? Or should I use util.Date for both? What is the right way?

Thank you very much,

Joe

+4
source share
2 answers

java.util.Date is probably the right choice. However, the question arises as to why you want to have a separate date and time in your model. A better option would be to have a single Date object containing the date and time, and if you need setters / getters to query for individual parts of the date / time, you can do this.

There is nothing to prevent you from using setters / getters in Play.

+2
source

You must definitely use java.utils.

EDIT: OK, to clarify, java.utils.Date is the one that is used (usually) with the Play Model.

+2
source

All Articles