List of usage examples for java.util Locale getDefault
public static Locale getDefault()
From source file:Main.java
public static String getFormatedData(Date date) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault()); if (date != null) { return sdf.format(date); } else {//from ww w . j a v a 2 s . co m return ""; } }
From source file:Main.java
public static String millisToStringDate(long millis, String pattern) { SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.getDefault()); return format.format(new Date(millis)); }
From source file:Main.java
public static boolean isRTL() { int layoutDirection = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()); return layoutDirection == ViewCompat.LAYOUT_DIRECTION_RTL; }
From source file:Main.java
public static String getTime(Long timestamp) { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.getDefault()); sdf.setTimeZone(TimeZone.getTimeZone("GMT+0")); Date date = new Date(timestamp * 1000); sdf.format(date);// ww w. ja v a 2 s . c o m return sdf.format(date); }
From source file:Main.java
public static String getNowTime() { Date now = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); String date = sdf.format(now); return date;//w ww . j av a2 s .co m }
From source file:Main.java
public static String getUserDate() { Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); String dateString = formatter.format(currentTime); return dateString; }
From source file:Main.java
public static String getCurrentTime(String format) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault()); String currentTime = sdf.format(date); return currentTime; }
From source file:Main.java
public static String firstCharUpper(String input) { if (input == null) return null; String firstChar = input.substring(0, 1).toUpperCase(Locale.getDefault()); return firstChar + input.subSequence(1, input.length()); }
From source file:Main.java
public static String dateToString(Date date) { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); return dateFormat.format(date); }
From source file:Main.java
public static String addDay(int day) { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd", Locale.getDefault()); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, day);// w w w . j ava2 s. c o m return dateFormat.format(cal.getTime()); }