I do a rs.getTimestamp(‘datetime’)
in Java.
In the database, this datetime is 2009/03/06 02:47:18
but the time is returned as 14:47:18
I’m not very knowledgeable about MySQL dates, so I would appreciate any explanation as to why this is happening.
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.
It doesn’t matter. Its not about MySQL or any database. This is the format Timestamp shows up by default, I believe. It doesn’t mean it missed the date or something.
You can always format the Timestamp returned by the method in any format in your code. Check out java.text.SimpleDateFormat class. Or for better, check out much more sophisticated Joda Time.