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 singltime(long time) {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    return simpleDateFormat.format(time);

}

From source file:Main.java

public static String timeStampToStr1(long timeStamp) {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    String date = sdf.format(timeStamp * 1000);
    return date;//from  w ww. j  a va  2  s  .  co m
}

From source file:Main.java

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

From source file:Main.java

public static String dateToStrLong(long dateDate) {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String dateString = formatter.format(dateDate);
    return dateString;
}

From source file:Main.java

public static String getTimeOfDay(long times) {
    return new SimpleDateFormat("HH:mm").format(new Date(times));
}

From source file:Main.java

public static String dateTimeChange(Date paramDate) {
    return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(paramDate);
}

From source file:Main.java

public static String getDateMDEHM(Long inputDate) {
    return new SimpleDateFormat("MM-dd E HH:mm").format(new Date(inputDate));
}

From source file:Main.java

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

From source file:Main.java

public static String getFechaActual() {
    SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    return df.format(new Date());
}

From source file:Main.java

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