Dates Formate
String pattern = “yyyy-MM-dd”;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); String date = simpleDateFormat. format(new Date());
System. out.
Shathana. S.R. Answered question
The java string format() method returns the formatted string by given locale, format and arguments.
If you don’t specify the locale in String.format() method, it uses default locale by calling Locale.getDefault() method.
The format() method of java language is like sprintf() function in c language and printf() method of java language.
BrindhaPrathaban Answered question
Dates Formate
String pattern = “yyyy-MM-dd”;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); String date = simpleDateFormat. format(new Date());
System. out.
Vishalini.R Answered question
