Example usage for java.util Locale US

List of usage examples for java.util Locale US

Introduction

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

Prototype

Locale US

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:Main.java

public static boolean isOGGFile(String in) {
    return in.toLowerCase(Locale.US).endsWith(".ogg");
}

From source file:Main.java

public static boolean isM4AFile(String in) {
    in = in.toLowerCase(Locale.US);
    return in.endsWith(".m4a") || in.endsWith(".m4p");
}

From source file:Main.java

public static String getStrTime() {
    return new SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.US).format(new Date());
}

From source file:Main.java

public static String getVersionString(final double price) {
    final NumberFormat nf = NumberFormat.getNumberInstance(Locale.US);
    final DecimalFormat df = (DecimalFormat) nf;
    df.applyPattern("###,###.####");
    final String output = df.format(price);
    return output;
}

From source file:Main.java

/**
 * Identifies if the device is manufactured by HTC
 *///from w w w  .  j  a  va 2 s  .c o  m
private static boolean isHtc() {
    return Build.MODEL != null && Build.MODEL.toLowerCase(Locale.US).contains("htc");
}

From source file:Main.java

public static String getMonthDayYear(Date date) {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM dd, yyyy", Locale.US);

    return simpleDateFormat.format(date);
}

From source file:Main.java

public static String getShortDateDisplay(Calendar cal) {
    return cal.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.US) + " " + cal.get(Calendar.DATE);
}

From source file:Main.java

public static boolean isFLACFile(String in) {
    in = in.toLowerCase(Locale.US);
    return in.endsWith(".flac") || in.endsWith(".fla");
}

From source file:Main.java

public static String convertMilliSecondsToDate(long milliseconds) {
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
    Date currentDate = new Date(milliseconds);
    return df.format(currentDate);

}

From source file:Main.java

public static SimpleDateFormat getDateTimeFormat() {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
    format.setTimeZone(TimeZone.getTimeZone("UTC"));
    return format;
}