This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Column type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Column type" Watch "Column type" New topic

Column type

Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
Hi friends,
I have a date column and it's type is Date. Do I need to have "SimpleDateFormat" in my program to format my date as well or not?

Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
That really depends on what you want to do with that Date object. The Date class has a toString() method which displays the date it contains, but you can't modify how this date if formatted using only the Date class. If you want to format it to a specific user's taste or to some general format of your own, you'll have to use the SimpleDateFormat class. However, if you don't need to display it in any special way, you won't need that class.

SCJP Tipline, etc.
I agree. Here's the link:
subject: Column type
Similar Threads
dynamic column names and it's values
weblogic jdbc, problem while retrieving date object.
Date or Timestamp?
How to get dates to ActionForm in Struts
Help with Date conversion from PostgreSQL database