Java Timestamp Format toDateFromTimestamp(String timestamp, String format)

Here you can find the source of toDateFromTimestamp(String timestamp, String format)

Description

to Date From Timestamp

License

Open Source License

Declaration

public final static String toDateFromTimestamp(String timestamp, String format) 

Method Source Code


//package com.java2s;
import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public final static String toDateFromTimestamp(String timestamp, String format) {
        DateFormat f = new SimpleDateFormat(format);
        Date dateObj = new Date(Long.parseLong(timestamp));
        return f.format(dateObj);
    }/* w  ww  . j a v  a 2 s .  c  o m*/
}

Related

  1. timeStampFormat(Timestamp t)
  2. timestampToFormattedDate(Long timestamp)
  3. timestampToString(final Date ts, final String format, final String tzId)
  4. timestampToString(Long timestamp, String formatStr)
  5. timeToString(long timestamp, SimpleDateFormat format)
  6. toHumanTime(long timestamp, String format)
  7. toReadableTime(Long timestamp, String format)
  8. toTimeStamp(String dateTime, SimpleDateFormat format, int timeZoneOffset)
  9. unixTimestamp(String date, String dateFormat)