my dog learned polymorphism*
The moose likes JDBC and the fly likes Date Format change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Date Format change" Watch "Date Format change" New topic
Author

Date Format change

Dan Silva
Ranch Hand

Joined: Sep 05, 2007
Posts: 86
Hi,
I want the date to be displayed with MM\DD\YYYY instead of the default, with the year first. What's the command to do this. Thanks
Dan Silva
Ranch Hand

Joined: Sep 05, 2007
Posts: 86
Sorry, I'm looking to do this in SQL. Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36475
    
  16
I had a look in the MySQL manual and found this. Look particularly at the first additional comment at the bottom.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

If its part of JDBC, use ResultSet.getDate() and Java's SimpleDateFormat to change the format. The specific command varies on different databases.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date Format change
 
Similar Threads
Head First Design Patterns Release Date
about dataBase books
Another format check :P
WA #1.....word association
How can I get sysdate in java?