Java Now at GMT getNowAtGMT()

Here you can find the source of getNowAtGMT()

Description

get Now At GMT

License

Open Source License

Declaration

public static String getNowAtGMT() 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static String getNowAtGMT() {
        final Date currentTime = new Date();
        final SimpleDateFormat sdf = new SimpleDateFormat("MM.dd.yyyy'T'hh:mm:ssa'.Zone:'z");
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        return sdf.format(currentTime);
    }/* www .j  a v  a2  s.  c om*/
}