Java Time in GMT getGMT(Date date)

Here you can find the source of getGMT(Date date)

Description

get GMT

License

Apache License

Declaration

public static String getGMT(Date date) 

Method Source Code


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

import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static DateFormat FORMAT = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.ENGLISH);

    public static String getGMT(Date date) {
        FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
        String dateString = FORMAT.format(date);
        return dateString;
    }/*from   w  ww  .  ja  v  a2 s .c  om*/
}

Related

  1. getGMT8Time()
  2. getGMTByDisplay(String tm)
  3. getGMTCalendarAtTime(String sTime)
  4. getGMTDate()