I am trying to format Date based on Locale value, I have gone through this post in SO but I am not able to get the data based on my requirement.
Here is what I have tried:
DateFormat f = DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK);
String d = f.format(new Date());
System.out.println(d);
This prints the output as :27/03/15
But for the year I want it to be printed as 2015
instead of 15
as shown in the output.
In case of US
locale the output should be 03/27/2015