• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date Format change

 
Dan Silva
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I'm looking to do this in SQL. Thanks.
 
Campbell Ritchie
Marshal
Posts: 53207
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a look in the MySQL manual and found this. Look particularly at the first additional comment at the bottom.
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If its part of JDBC, use ResultSet.getDate() and Java's SimpleDateFormat to change the format. The specific command varies on different databases.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!