Java Timestamp Convert To toGmtTimestampString(Timestamp timestamp)

Here you can find the source of toGmtTimestampString(Timestamp timestamp)

Description

to Gmt Timestamp String

License

Apache License

Declaration

public static String toGmtTimestampString(Timestamp timestamp) 

Method Source Code


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

import java.sql.Timestamp;
import java.text.DateFormat;

import java.util.TimeZone;

public class Main {
    public static String toGmtTimestampString(Timestamp timestamp) {
        DateFormat df = DateFormat.getDateTimeInstance();
        df.setTimeZone(TimeZone.getTimeZone("GMT"));
        return df.format(timestamp);
    }/* ww w . ja va2s. com*/
}

Related

  1. toDecimal(Timestamp instant)
  2. toEnglishDateTime(java.sql.Timestamp ts)
  3. toEnglishHours(java.sql.Timestamp ts)
  4. toEPICSTime(java.sql.Timestamp timestamp)
  5. toFormatedString(final Timestamp ts, final String timeZoneId)
  6. toInstant(final Timestamp timestamp)
  7. toJavaDate(Timestamp dt)
  8. toLocalDateTime(Timestamp timestamp)
  9. toMediaWikiString(Timestamp timestamp)