Java Code Examples for java.util.Locale.PRC

The following are Jave code examples for showing how to use PRC of the java.util.Locale class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: GitHub   File: DateUtils.java   View Source Code Vote up 5 votes
/**
 * 将yyyy-MM-dd HH:mm:ss字符串转换成日期<br/>
 *
 * @param dateStr    时间字符串
 * @param dataFormat 当前时间字符串的格式。
 * @return Date 日期 ,转换异常时返回null。
 */
public static Date parseDate(String dateStr, String dataFormat) {
    try {
        SimpleDateFormat dateFormat = new SimpleDateFormat(dataFormat, Locale.PRC);
        Date date = dateFormat.parse(dateStr);
        return new Date(date.getTime());
    } catch (ParseException e) {
        LogUtils.warn(e);
        return null;
    }
}
 
Example 2
Project: otter-G   File: ObjectProfiler.java   View Source Code Vote up 5 votes
private static boolean isSharedFlyweight(Object obj) {
    if (obj == null) {
        return true;
    }
    if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
        return true;
    }
    if (/* obj == Locale.ROOT || *//* Java 6 */
    obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
            || obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
            || obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
            || obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
            || obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
            || obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
        return true;
    }
    if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
        return true;
    }
    if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
        return true;
    }
    if (obj == System.in || obj == System.out || obj == System.err) {
        return true;
    }
    if (obj == String.CASE_INSENSITIVE_ORDER) {
        return true;
    }
    if (obj == JarFile.MANIFEST_NAME) {
        return true;
    }
    return false;
}
 
Example 3
Project: CXJPadProject   File: DateUtils.java   View Source Code Vote up 5 votes
/**
 * 将yyyy-MM-dd HH:mm:ss字符串转换成日期<br/>
 *
 * @param dateStr    时间字符串
 * @param dataFormat 当前时间字符串的格式。
 * @return Date 日期 ,转换异常时返回null。
 */
public static Date parseDate(String dateStr, String dataFormat) {
    try {
        SimpleDateFormat dateFormat = new SimpleDateFormat(dataFormat, Locale.PRC);
        Date date = dateFormat.parse(dateStr);
        return new Date(date.getTime());
    } catch (ParseException e) {
        LogUtils.warn(e);
        return null;
    }
}
 
Example 4
Project: GitHub   File: DateUtils.java   View Source Code Vote up 4 votes
/**
 * 将指定的日期转换为一定格式的字符串
 */
public static String formatDate(Date date, String format) {
    SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.PRC);
    return sdf.format(date);
}
 
Example 5
Project: CXJPadProject   File: DateUtils.java   View Source Code Vote up 4 votes
/**
 * 将指定的日期转换为一定格式的字符串
 */
public static String formatDate(Date date, String format) {
    SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.PRC);
    return sdf.format(date);
}