List of usage examples for java.text SimpleDateFormat SimpleDateFormat
public SimpleDateFormat(String pattern)
SimpleDateFormat
using the given pattern and the default date format symbols for the default java.util.Locale.Category#FORMAT FORMAT locale. From source file:Main.java
public static String currentTime() { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); return df.format(new Date()); }
From source file:Main.java
public static String getDDMMYYYYFromDate(Date date) { return new SimpleDateFormat("MM/dd/yyyy").format(date); }
From source file:Main.java
public static String getTxtFileName() { String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmmSS").format(new Date()); String fileName = "db" + timeStamp + ".txt"; return fileName; }
From source file:Main.java
public static String getToday() { SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); return df.format(Calendar.getInstance().getTime()); }
From source file:Main.java
public static String getCurrentTimeString(long time) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); String dateString = formatter.format(time); return dateString; }
From source file:Main.java
public static String getDefaultDateFormat(long time) { return new SimpleDateFormat("a h:mm").format(new Date(time)); }
From source file:Main.java
public static String now() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return dateFormat.format(Calendar.getInstance().getTime()); }
From source file:Main.java
public static String getNowTime() { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); return sdf.format(Calendar.getInstance().getTime()); }
From source file:Main.java
public static String getTimeNow() { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); String time = sdf.format(new Date()); return time;/*w w w .j a va 2s . co m*/ }
From source file:Main.java
public static String getCurrentDateFormat(String dateFormat) { SimpleDateFormat format = new SimpleDateFormat(dateFormat); return format.format(new java.util.Date()); }