Java Utililty Methods Timestamp to String

List of utility methods to do Timestamp to String

Description

The list of methods to do Timestamp to String are organized into topic(s).

Method

Stringtimestamp2Str(Timestamp time, String format)
timestamp Str
Date date = null;
if (null != time) {
    if (format == null) {
        format = PATTERN_YMDHMS;
    date = new Date(time.getTime());
return dateToString(date, format);
...
Stringtimestamp2String(final java.sql.Timestamp value)
Convert timestamp to string
return value.toString();
Stringtimestamp2String(Timestamp timestamp, String pattern)
timestamp String
if (timestamp == null) {
    throw new java.lang.IllegalArgumentException("timestamp null illegal");
if (pattern == null || pattern.equals("")) {
    pattern = PATTERN_STANDARD;
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(new Date(timestamp.getTime()));
...
StringtimestamptoStr(Timestamp time)
timestampto Str
return date2Str(yyyy_MM_dd);
StringtimeStampToString(final Timestamp timestamp, final String format)
Time stamp to string.
return dateToString(new Date(timestamp.getTime()), format);
StringtimestampToString(java.sql.Timestamp a_Timestamp, String aS_Format)
Converts java.sql.Timestamp to String with using specified format
if (aS_Format == null) {
    aS_Format = "yyyy-MM-dd hh:mm:ss";
if (a_Timestamp == null)
    return "";
SimpleDateFormat l_SimpleDateFormat = new SimpleDateFormat(aS_Format);
return l_SimpleDateFormat.format(a_Timestamp);
StringtimestampToString(long timestamp)
Provides a readable string for given timestamp
return (new Timestamp(timestamp) + "00").substring(0, 23);
StringtimestampToString(long timestamp)
timestamp To String
return new SimpleDateFormat("dd/MM/yyyy").format(new Date(timestamp * 1000L));
StringtimeStampToString(Timestamp date, String dateFmt)
time Stamp To String
String strTemp = null;
if (date != null) {
    String dtFmt = dateFmt;
    if (null == dtFmt)
        dtFmt = "yyyy-MM-dd";
    SimpleDateFormat formatter = new SimpleDateFormat(dtFmt);
    strTemp = formatter.format(date);
return strTemp;
StringtimestampToString(Timestamp now, String pattern)
timestamp To String
SimpleDateFormat sf = new SimpleDateFormat(pattern);
return sf.format(now);