Oct 01

Either use the format() method of the SimpleDateFormat class, or the (static) format() method of the String class.

DateFormat dateFormat = new SimpleDateFormat("hhmmddMMyy");
Date today = new Date();
String formatted = dateFormat.format(today);
String formatted2 = 
   String.format("%<tH%<tM%<tS%tY%<tm%<td", today);

written by objects \\ tags: , , ,

Leave a Reply

You must be logged in to post a comment.