Home > Back-end >  Java how to implement the format the date when the output is in English
Java how to implement the format the date when the output is in English

Time:10-19

Public class Format {
Public static void main (String [] args) {
Date date=new Date();
String s1=the String. Format (" % TB ", date);
String s2=the String. Format (" % tB ", date);
Result is in Chinese how to output in English in October

CodePudding user response:

Try format to specify the locale parameter
The String. Format (Locale. The US, "% TB", date);
  • Related