This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am trying to save a xml file. I want to retrieve the system date and name the file as systemdate stamp like mmddyyhrminutes(in this format). Do you know how to retrieve system date and format it in that way
You can get the current date/time by simply creating a java.util.Date instance with the default constructor. If you need to use a java.sql.Date for whatever reason, you need to initialize it as new java.sql.Date( System.currentTimeMillis() ). You can format the date as you like using a java.text.DateFormat instance. hth, bear