java.ut套件 在 Java se6中,您可以直接使用 getDisplaynames0或 getDisplay小 Nameo方 法取得区城仁的日期格式显示 Calendar rightNow Calendar getInstance ()i Localelocale Locale get Default()i System.out. print1n("现在时间是:" System. out. printf("s:d on", rightNow. getDisplayName(ERA, LONG, locale) rightNow. get(YEAR)) System.out. println( rightNow. getDisplayName(Month, LoNG, locale))i System.out. printf("号d日n", rightNow. get(DAY OF MONTH))i System. out. println( rightNow. getDisplayName(DAY OF WEEK, LonG, locale)java.util套件 • 在Java SE 6中,您可以直接使用 getDisplayNames()或getDisplayName()方 法取得区域化的日期格式显示 Calendar rightNow = Calendar.getInstance(); Locale locale = Locale.getDefault(); System.out.println("现在时间是:"); System.out.printf("%s:%d %n", rightNow.getDisplayName(ERA, LONG, locale), rightNow.get(YEAR)); System.out.println( rightNow.getDisplayName(MONTH, LONG, locale)); System.out.printf("%d日%n", rightNow.get(DAY_OF_MONTH)); System.out.println( rightNow.getDisplayName(DAY_OF_WEEK, LONG, locale));