This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori 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