Example usage for java.util Locale CHINA

List of usage examples for java.util Locale CHINA

Introduction

In this page you can find the example usage for java.util Locale CHINA.

Prototype

Locale CHINA

To view the source code for java.util Locale CHINA.

Click Source Link

Document

Useful constant for country.

Usage

From source file:Main.java

public static String formatDate(String format, Long time) {
    return formatDate(new SimpleDateFormat(format, Locale.CHINA), time);
}

From source file:Main.java

public static String getCurrentMonth(long time) {
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM", Locale.CHINA);
    return dateFormat.format(time);
}

From source file:Main.java

public static String getNowDatetimeStr() {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.CHINA);
    Date date = new Date();
    return sdf.format(date);
}

From source file:Main.java

public static String getCurrentDate(long time) {
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
    return dateFormat.format(time);
}

From source file:Main.java

public static String formatDate(long time) {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
    return simpleDateFormat.format(new Date(time * 1000));
}

From source file:Main.java

public static String getCurrentServerTime(long time) {
    DateFormat dateFormat = new SimpleDateFormat("HH:mm", Locale.CHINA);
    return dateFormat.format(time);
}

From source file:Main.java

public static String formatTime(long time) {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
    return formatter.format(new Date(time));
}

From source file:Main.java

public static String getCurrentDateForSecond() {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
    Date curDate = new Date(System.currentTimeMillis());
    return formatter.format(curDate);
}

From source file:Main.java

public static String convertCurrentChinaDateToStr() {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSS", Locale.CHINA);
    // dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+0000"));
    String dateStr = dateFormat.format(new Date());
    return dateStr;
}

From source file:Main.java

public static String timeFormat(Date date, String formatter) {
    SimpleDateFormat dateformat = new SimpleDateFormat(formatter, Locale.CHINA);
    String formattime = dateformat.format(date);
    return formattime;
}