I’m using Joda, and I’m making a class to store the timestamp for a transaction and persist to a DB. Should I be using an Instant or a DateTime?
I’m using Joda , and I’m making a class to store the timestamp for
Share
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.
Use whichever one best fits your model.
Instantis a representation of a millisecond timestamp value,DateTimeis a calendar-based object. Each one can be easily converted into the other, so there’s no need to restrict your model according what the database needs.So you need to ask yourself – what data am I actually modelling? Is it a year/month/day/hour/minute/second/etc value, or is it just an arbitrary moment in time with no particular meaning?