Java Timestamp Format timeStamp2Date(String seconds, String format)

Here you can find the source of timeStamp2Date(String seconds, String format)

Description

time Stamp Date

License

Artistic License

Declaration

public static String timeStamp2Date(String seconds, String format) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String timeStamp2Date(String seconds, String format) {
        if (seconds == null || seconds.isEmpty() || seconds.equals("null")) {
            return "";
        }/*w ww.j  a v a2s . com*/
        if (format == null || format.isEmpty())
            format = "yyyy-MM-dd HH:mm:ss";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date(Long.valueOf(seconds)));
    }
}

Related

  1. getTimeStampFormat(Date date)
  2. getTimestampFormat(long time)
  3. sortedTimestampFormat(Date date)
  4. stringConvertToTimestamp(String value, String format)
  5. TimeStamp2Date(long timestampString, String formats)
  6. Timestamp2DDMMYYYY(java.sql.Timestamp ts)
  7. Timestamp2HHMMSS(java.sql.Timestamp ts, int iStyle)
  8. timestamp2String(long source, DateFormat format)
  9. Timestamp2UTC(Timestamp mytime)