Here you can find the source of getGMTime()
public static String getGMTime()
//package com.java2s; /*//from w ww .j av a2 s. co m * @(#) UtilsLib.java version 1.0 24/5/2013 * * Copyright (C) 2013 Institute for the Management of Information Systems, Athena RC, Greece. * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import java.text.SimpleDateFormat; import java.util.TimeZone; public class Main { /** * Get the current GMT time for user notification. * * @return timestamp value as string. */ public static String getGMTime() { SimpleDateFormat gmtDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); gmtDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); //Current Date Time in GMT return gmtDateFormat.format(new java.util.Date()); } }