首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

中文年份显示有关问题

2012-12-15 
中文年份显示问题ModelFormField2000//DateFormat dateFormatter DateFormat.getDateInstance(DateForma

中文年份显示问题

ModelFormField  2000

//DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, locale);
                    DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, locale);
                    /**
                     * fix china chinese date display
                     */
            if(locale.equals(Locale.CHINA)||locale.equals(Locale.CHINESE)){
            dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT, locale);
            }

UtilDateTime 988

public static DateFormat toDateTimeFormat(String dateTimeFormat, TimeZone tz, Locale locale) {
        DateFormat df = null;
        if (UtilValidate.isEmpty(dateTimeFormat)) {
            df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
            /**
             * fix china chinese date display
             */
    if(locale.equals(Locale.CHINA)||locale.equals(Locale.CHINESE)){
    df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.MEDIUM, locale);
    }
        } else {
            df = new SimpleDateFormat(dateTimeFormat);
        }
        df.setTimeZone(tz);
        return df;
    }

热点排行