Java 日期时间格式化显示简短月1


Java 日期时间格式化显示简短月1

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Calendar;

public class Main {
   public static void main(String[] argv) throws Exception {
      String str1 = "dd-MMM-yy";
      Date d = Calendar.getInstance().getTime();
      SimpleDateFormat sdf = new SimpleDateFormat(str1, Locale.FRENCH);
      System.out.println(sdf.format(d));
      sdf = new SimpleDateFormat(str1, Locale.ENGLISH);
      System.out.println(sdf.format(d));
   }
}