Java示例当前月份简称格式


Java示例当前月份简称格式

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));

   }

}