Java Timestamp Parse parseTimestampToString(Timestamp stamp, String dateFormat)

Here you can find the source of parseTimestampToString(Timestamp stamp, String dateFormat)

Description

parse Timestamp To String

License

Apache License

Parameter

Parameter Description
stamp a parameter
dateFormat a parameter

Return

String

Declaration

public static String parseTimestampToString(Timestamp stamp, String dateFormat) 

Method Source Code


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

import java.sql.Timestamp;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /***//  w  w w  .j  av  a  2  s.c o m
     * 
     * @param stamp
     * @param dateFormat
     * @return String
     */
    public static String parseTimestampToString(Timestamp stamp, String dateFormat) {
        SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
        return sdf.format(new Date(stamp.getTime()));
    }
}

Related

  1. parseTimeStamp(String timeStampString)
  2. parseTimestamp(String value)
  3. parseTimestamp(String value)
  4. parseTimestamp2Long(String datestring, String datepattern, TimeZone timeZone)
  5. parseTimestampDirectory(final String stamp)
  6. parseToDate(String timestamp, String pattern)
  7. str2Timestamp(String str)
  8. String2Timestamp(String date)
  9. String2Timestamp(String s, String fmt)