Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

db date value problam

 
raj baig
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj,
It is giving you the value to second precision. You can use SimpleDateFormat to format it without the milliseconds.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic