File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes db date value problam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "db date value problam" Watch "db date value problam" New topic

db date value problam

raj baig
Ranch Hand

Joined: Jul 11, 2006
Posts: 96
hi all,
i am using mysql db.i have stored the date in mysql table using
now().it stored as : 2006-09-18 11:38:03

But when i retrieved that value using jdbc in my application it is adding zero at the end. like : 2006-09-18 11:38:03:0

can all guess why it is happening like this.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30123

It is giving you the value to second precision. You can use SimpleDateFormat to format it without the milliseconds.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
wood burning stoves
subject: db date value problam
Similar Threads
How to store arraylist in xml file
Running application on web start
can you do that in one query?
Query problem with MySQL 5
UnsupportedClassVersionError, Can the good people help