List of usage examples for java.text SimpleDateFormat format
public final String format(Date date)
From source file:Main.java
public static String getCurrentDate(String format) { Date dt = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(dt); }
From source file:Main.java
public static String formatFromDate(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); }
From source file:Main.java
public static String getCurrentDateFormat(String dateFormat) { SimpleDateFormat format = new SimpleDateFormat(dateFormat); return format.format(new java.util.Date()); }
From source file:Main.java
public static String long2date(String format, long mill) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(mill); }
From source file:Main.java
public static String getWeekNumberFromSeconds(long secs) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(secs * 1000L);/* www . j a v a 2s .c om*/ SimpleDateFormat format1 = new SimpleDateFormat("ww"); return format1.format(c.getTime()); }
From source file:Main.java
public static String getDateTimeYYmm() { String paramFormat = "yyyy-MM-dd"; SimpleDateFormat sdf = new SimpleDateFormat(paramFormat); return sdf.format(System.currentTimeMillis()).toString(); }
From source file:Main.java
public static String convertDateToString(Date dateTime) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); return df.format(dateTime); }
From source file:Main.java
public static String getFormatTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); }
From source file:Main.java
public static String getDateAs(String format) { SimpleDateFormat formatter = new SimpleDateFormat(format); return formatter.format(new Date(System.currentTimeMillis())); }
From source file:Main.java
public static String getCurrentDate() { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); return df.format(Calendar.getInstance().getTime()); }