File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formatting Date Object

 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to format an object of java.util.Date into the dd/mm/yy format. Im using it for a database program in which the date is implicitly inserted into a table when a function is called, and ive been trying to get the date in dd/mm/yy format.
Any ideas?
 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're trying to format the date into a String (in whatever format) so that you can insert it into a database table, in a column that is declared as DATE, then the best idea is to not do that. Use a PreparedStatement:However if it's a text column (which also sounds like not such a good idea) or if you just need the date formatted so you can display it, then use a java.text.SimpleDateFormat object to do that.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic