Example usage for java.text SimpleDateFormat SimpleDateFormat

List of usage examples for java.text SimpleDateFormat SimpleDateFormat

Introduction

In this page you can find the example usage for java.text SimpleDateFormat SimpleDateFormat.

Prototype

public SimpleDateFormat(String pattern) 

Source Link

Document

Constructs a SimpleDateFormat using the given pattern and the default date format symbols for the default java.util.Locale.Category#FORMAT FORMAT locale.

Usage

From source file:Main.java

public static String GetDateString(long timestamp) {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    return format.format(new Date(timestamp));
}

From source file:Main.java

public static String getDateFormatString(Date date) {
    SimpleDateFormat fdm = new SimpleDateFormat("yyyy-MM-dd");
    return fdm.format(date);
}

From source file:Main.java

public static String getFormattedDate(Calendar cal) {
    SimpleDateFormat sdf = new SimpleDateFormat("d MMMM yyyy, h a");
    return sdf.format(cal.getTime());
}

From source file:Main.java

public static String dateLongFormatString(Date date) {
    SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd MMMM yyyy");
    String _date = sdf.format(date);
    return _date;
}

From source file:Main.java

public static String formatDateYYYYMMDDHHMM(long date) {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    return sdf.format(new Date(date));
}

From source file:Main.java

public static String timesOne(String time) {
    SimpleDateFormat sdr = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
    @SuppressWarnings("unused")
    long lcc = Long.valueOf(time);
    int i = Integer.parseInt(time);
    String times = sdr.format(new Date(i * 1000L));
    return times;
}

From source file:Main.java

public static String setTimeDateDd(long time) {
    SimpleDateFormat format = new SimpleDateFormat("MM-dd");
    String timeDate = format.format(new Date(time));
    return timeDate;
}