Here you can find the source of getNowAtGMT()
public static String getNowAtGMT()
//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*/ }