Java Time in GMT getGMTString(Date d)

Here you can find the source of getGMTString(Date d)

Description

get GMT String

License

Apache License

Declaration

public static String getGMTString(Date d) 

Method Source Code


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

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;
import java.util.TimeZone;

public class Main {
    public static String getGMTString(Date d) {
        DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);// ();
        format.setTimeZone(TimeZone.getTimeZone("GMT"));
        return format.format(d);
    }/*from  ww w  .j a  va  2  s. co  m*/
}

Related

  1. getGMTDatetime(Date datetime)
  2. getGMTDatetimeFormat()
  3. getGmtFromTimeInMillis(String val)
  4. getGMTime()
  5. getGMTime()
  6. getGMTString(Date date, TimeZone tz)
  7. getGMTTime(Date localTime)
  8. getGMTTime(final Date date)
  9. getGMTTimeStr(Date pageTime, int offset)