Java Timestamp Format timestampFormat(Date date)

Here you can find the source of timestampFormat(Date date)

Description

timestamp Format

License

Apache License

Declaration

public static String timestampFormat(Date date) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String timestampFormat(long timestamp) {
        return timestampFormat(new Date(timestamp));
    }/*from  w ww  .j ava2s. c  om*/

    public static String timestampFormat(Date date) {
        return getTimetampFormat().format(date);
    }

    public static DateFormat getTimetampFormat() {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    }
}

Related

  1. Timestamp2HHMMSS(java.sql.Timestamp ts, int iStyle)
  2. timestamp2String(long source, DateFormat format)
  3. Timestamp2UTC(Timestamp mytime)
  4. timestampConvertToString(int timeStamp, String format)
  5. timeStampForFileName(final String simpleDateFormat)
  6. timestampFormat(final Date date)
  7. timeStampFormat(Timestamp t)
  8. timestampToFormattedDate(Long timestamp)
  9. timestampToString(final Date ts, final String format, final String tzId)