Q:

(Java) How to get current date in YY.MM.DD form?

I would like to store the current date in YY.MM.DD (separated by periods, if that's possible) into a string. Thanks for your help!

A:

You can use a SimpleDateFormat like this - 
public static void main(String[] args) {
  // The format.
  DateFormat sdf = new SimpleDateFormat("yy.MM.dd");
  Date theDate = new Date(); // a date.
  String dateStr = sdf.format(theDate); // to a String. dateStr for example.
  System.out.println(dateStr); // Print it out.
}

