This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date or Timestamp?  RSS feed

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table column that stores Date in default format 'dd-MON-yy'
I use JDBC to retrieve this column but I need it to display hour and minute and am/pm for my struts 2 app.

I am wondering if I should change the column to Timestamp instead of Date, does Timestamp record more info down to hour and minute compare to Date type?

Thanks in advance
 
author & internet detective
Marshal
Posts: 38367
645
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Davie,
You are correct. Timestamp stores both date and time in a database. Date stores just date.
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!