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 month(Date now) { SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM"); String strDate = sdfDate.format(now); return strDate; }
From source file:Main.java
public static String dateCastDay(Date d) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(d); }
From source file:Main.java
public static String getCurrentDate() { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); return df.format(Calendar.getInstance().getTime()); }
From source file:Main.java
public static String formatSystemTime() { SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss"); return format.format(new Date()); }
From source file:Main.java
public static String getCurrentTime() { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd "); String currenttime = df.format(new Date()); return currenttime; }
From source file:Main.java
public static String getCurrentDate() { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); return formatter.format(new Date()); }
From source file:Main.java
public static String getDateTime() { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(); String dateTime = format.format(date); return dateTime; }
From source file:Main.java
public static String getCurrentTime() { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return format.format(new Date()); }
From source file:Main.java
public static String toStringDate(Date date) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return df.format(date); }
From source file:Main.java
public static String formatDate(Date time) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return format.format(time); }